一切福田,不離方寸,從心而覓,感無不通。

Category Archives: Programming Language

Android模拟器上不了网的解决办法

龙生   25 Nov 2013
View Details

如何配置Eclipse PHP 集成开发工具(PDT)

下载Eclipse PDT All-In-One http://download.eclipse.org/tools/pdt/downloads/ 安装Zend Debugger   · 选择Help->Software Updates->Find and Install · 选择 Search for new features to install, 点击 Next · 点击 the New Remote Site 按钮… Name: Zend Debugger URL: http://downloads.zend.com/pdt · Zend Debugger 现在在Sites to include in search 列表被选中, 点击 Finish按钮。 同样的方式安装JSEclipse(如果需要团队合作还可以装上Subclipse提供对Subversion 的支持) Name: JSEclipse URL: http://download.macromedia.com/pub/labs/jseclipse/autoinstall Name: Subclipse 1.2.x URL: http://subclipse.tigris.org/update_1.2.x Name: Aptana URL:  http://update.aptana.com/update/3.2/ PDT调试方法 PHP Executable Debugger Zend Executable Debugger – 免费的Eclipse插件,在Eclipse 环境提供可执行的调试功能 PHP Web Server Debugger Zend Web Server Debugger – 安装在Web 服务器端的调试工具 XDebug Components – XDebug用于Web 服务器端的调试 注:版本发布类型 Released Builds – 稳定经过测试的发布版,可能不包含最新的功能特性 Stable […]

龙生   23 Nov 2013
View Details

node.js Tools for Visual Studio

node.js Tools for Visual Studio 提供了在 Visual Studio 中开发 Node.js 应用的扩展。 软件首页 软件下载 转自:http://www.oschina.net/p/nodejstools

龙生   23 Nov 2013
View Details

Eclipse 3.7 / Indigo / PDT 3.0

From Update Site Prerequisites Installed and running Eclipse Classic 3.7 The minimum package is Eclipse Platform Runtime Binary. It is available at here Any packages in Eclipse Downloads page are available also. Installation Flow Open Help -> Install New Software. Select the Indigo update site. When the list of existing features is populated – select 'PHP Development Tools'. Make sure 'Contact all update sites…' is checked. Proceed with the installation by pressing 'Next', then press 'Next' again in the next screen. Accept the EULA when asked: Finish the […]

龙生   21 Nov 2013
View Details

android虚拟机如何安装应用程序

1、搭建好android开发环境 2、启动android虚拟机(Eclipse下启动也可) 3、Windows系统打开cmd,进入android-sdk-windows\platform-tools目录 4、输入 adb install xxx.apk ;注意cmd下安装时不要使用中文,避免发生错误 5、刷新android虚拟机桌面,测试该应用程序   在android虚拟机中安装文件管理器后,即可进入文件管理操作; 在电脑上下载安装包 xxx.apk 后安装该软件到android虚拟机中,再借助文件管理器进行更简便的安装操作 转自:http://wu110cheng.blog.163.com/blog/static/133349654201232242429902/

龙生   20 Nov 2013
View Details

ASP.NET实现二维码(QRCode)的创建和读取

QR二维码比其他二维码相比,具有识读速度快、数据密度大、占用空间小的优势。QR码的三个角上有三个寻象图形,使用CCD识读设备来探测码的位置、大小、倾斜角度、并加以解码,实现360度高速识读。每秒可以识读30个含有100个字符QR码。QR码容量密度 大,可以放入1817个汉字、7089个数字、4200个英文字母。QR码用数据压缩方式表示汉字,仅用13bit即可表示一个汉字,比其他二维条码表示汉字的效率提高了20%。QR具有4个等级的纠错功能,即使破损也能够正确识读。QR码抗弯曲的性能强,通过QR码中的每隔一定的间隔配置有校正图形,从码的外形来求得推测校正图形中心点与实际校正图形中心点的误差来修正各个模快的中心距离,即使将QR码贴在弯曲的物品上也能够快速识读。QR码可以分割成16个QR码,可以一次性识读数个分割码,适应于印刷面积有限及细长空间印刷的需要。此外微型QR码可以在1厘米的空间内放入35个数字或9个汉字或21个英文字母,适合对小型电路板对ID号码进行采集的需要。(From:http://tuqiang9999.blog.163.com/blog/static/33241320111115103159542/) QRCode下载地址:ThoughtWorks.QRCode(支持中文)   一、项目引用QRCode的DLL文件(ThoughtWorks.QRCode.dll) 二、ASPX页面(两个jquery的js文件请自行去官网下载): <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server">     <title>二维码工具测试</title>     <script type="text/javascript" src="../../Scripts/Jquery/jquery-1.6.2.js"></script>     <script type="text/javascript" src="../../Scripts/Jquery/jquery.form.js"></script>     <script type="text/javascript" src="js/test.js"></script>     <style type="text/css">         .style1         {             width: 100%;         }         #txt_qr         {             width: 632px;         }     </style> </head> <body>     <div>         <table class="style1">             <tr>                 <td>                     输入文字:                 </td>                 <td>                     <input type="text" id="txt_qr" name="txt_qr" />                 </td>             </tr>             <tr>                 <td>                     二维码图片                 </td>                 <td>                     <img id="qrimg" alt="二维码图片" />                 </td>             </tr>             <tr>                 <td>                     生成选项                 </td>                 <td>                     Encoding:<select id="Encoding">                         <option value="Byte">Byte</option>                         <option value="AlphaNumeric">AlphaNumeric</option>                         <option value="Numeric">Numeric</option>                     </select>                     Correction Level:<select id="Level">                         <option value="M">M</option>                         <option value="L">L</option>                         <option value="Q">Q</option>                         <option value="H">H</option>                     </select>                     Version:<input id="txt_ver" type="text" value="7" />(1-40) Size:<input id="txt_size"                         type="text" value="4" />                 </td>             </tr>             <tr>                 <td colspan="4">                     <input type="button" onclick="getQrImg();" value="生成二维码" />                 </td>             </tr>             <tr>                 <td>                     <form id="qrForm" action="Ashx/test.ashx" method="post" enctype="multipart/form-data">                     <input type="file" id="file_qr" name="file_qr" /><input type="submit" value="读取二维码" />                     </form>                 </td>                 <td colspan="1">                     <img id="img_qr" alt="要读取的图片" /><br />                     <input id="txt_readqr" type="text" />                 </td>             </tr>         </table>     </div> </body> </html> 三、test.js文件 [javascript] $(document).ready(function () {     var options = {         beforeSubmit: showRequest, […]

龙生   14 Nov 2013
View Details

MVC Razor模板引擎 @RenderBody、@RenderPage、@RenderSection及Html.RenderPartial、Html.RenderAction

一、Views文件夹 -> Shared文件夹下的 _Layout.cshtml 母版页 @RenderBody 当创建基于_Layout.cshtml布局页面的视图时,视图的内容会和布局页面合并,而新创建视图的内容会通过_Layout.cshtml布局页面的@RenderBody()方法呈现在标签之间。   @RenderPage 从名称可以猜出来这个方法是要呈现一个页面。比如网页中固定的头部可以单独放在一个共享的视图文件中,然后在布局页面中通过这个方法调用,用法如下: @RenderPage(“~/Views/Shared/_Header.cshtml”) 带参数 @RenderPage(“~/Views/Shared/_Header.cshtml”,new{parm="my",parm2="you") 调用页面获取参数: //获取 RenderPage() 传递过来的参数 @PageData["param"]   @RenderSection 布局页面还有节(Section)的概念,也就是说,如果某个视图模板中定义了一个节,那么可以把它单独呈现出来 为了防止因缺少节而出现异常,可以给RenderSection()提供第2个参数: @RenderSection("head", false) 或 @if (IsSectionDefined("head")) { @RenderSection("head", false) } else { <p>SubMenu Section is not defined!</p> }   代码如下: [html] view plaincopy <!DOCTYPE html> <html> <head>     <title>@ViewBag.Title</title>     <link href="@Url.Content("~/Content/Site.css")" rel="stylesheet" type="text/css" />     <script src="@Url.Content("~/Scripts/jquery-1.4.4.min.js")" type="text/javascript"></script>     @RenderSection("head", required: true)@*View页面自定义特定js/css使用*@ </head> <body>     @RenderPage("~/Views/Shared/_Header.cshtml")     @RenderBody() </body> </html>   二、创建视图,使用母版页 代码如下: [html] view plaincopy @{     ViewBag.Title = "Index";     Layout = "~/Views/Shared/_Layout.cshtml"; } <h2>Index</h2> @section Head{     <script type="text/javascript">         $(function () {             alert("hello jquery");         });     </script> } <p>执行C#普通语法</p><br /> @DateTime.Now.Date.ToShortDateString() <p>执行C#语句段</p> @{     List<string> list = new List<string> { "Mvc3", "Razor" };     list.Add(".Net4"); } <ul> @foreach(string s in list) {     if (string.IsNullOrEmpty(s))     {        <li>空</li>     }     else […]

龙生   14 Nov 2013
View Details

asp.net获取当前网址url的各种属性(文件名、参数、域名 等)的代码

设当前页完整地址是:http://www.jb51.net/aaa/bbb.aspx?id=5&name=kelli "http://"是协议名 "www.jb51.net"是域名 "aaa"是站点名 "bbb.aspx"是页面名(文件名) "id=5&name=kelli"是参数 【1】获取 完整url (协议名+域名+站点名+文件名+参数) 复制代码代码如下: string url=Request.Url.ToString(); url= http://www.jb51.net/aaa/bbb.aspx?id=5&name=kelli 【2】获取 站点名+页面名+参数: 复制代码代码如下: string url=Request.RawUrl; (或 string url=Request.Url.PathAndQuery;) url= /aaa/bbb.aspx?id=5&name=kelli 【3】获取 站点名+页面名: 复制代码代码如下: string url=HttpContext.Current.Request.Url.AbsolutePath; (或 string url= HttpContext.Current.Request.Path;) url= aaa/bbb.aspx 【4】获取 域名: 复制代码代码如下: string url=HttpContext.Current.Request.Url.Host; url= www.jb51.net 【5】获取 参数: 复制代码代码如下: string url= HttpContext.Current.Request.Url.Query; url= ?id=5&name=kelli 复制代码代码如下: Request.RawUrl:获取客户端请求的URL信息(不包括主机和端口)——>/Default2.aspx Request.ApplicationPath:获取服务器上ASP.NET应用程序的虚拟路径。——>/ Request.CurrentExecutionFilePath:获取当前请求的虚拟路径。——>/Default2.aspx Request.Path:获取当前请求的虚拟路径。——>/Default2.aspx Request.PathInfo:取具有URL扩展名的资源的附加路径信息——> Request.PhysicalPath:获取与请求的URL相对应的物理文件系统路径。——>E:\temp\Default2.aspx Request.Url.LocalPath:——>/Default2.aspx Request.Url.AbsoluteUri:——>http://localhost:8080/Default2.aspx Request.Url.AbsolutePath:—————————->/Default2.aspx   转自:脚本无忧

龙生   14 Nov 2013
View Details

C#的Byte[]和stream

1、Byte[] ===== 1. BitConverter 将基础数据类型与字节数组相互转换。注意string不是基础类型,而且该方法在不同平台间传递可能有误。 int i = 13; byte[] bs = BitConverter.GetBytes(i); Console.WriteLine(BitConverter.ToInt32(bs, 0)); 2. Encoding 注意慎用Encoding.Default,其值取自操作系统当前的设置,因此在不同语言版本的操作系统是不相同的。建议使用UTF8或者GetEncoding(”gb2312″)。 string s = "abc"; byte[] bs = Encoding.UTF8.GetBytes(s); Console.WriteLine(Encoding.UTF8.GetString(bs)); 3. BinaryFormatter 以二进制格式将对象或整个连接对象图形序列化和反序列化。 using System.Runtime.Serialization; using System.Runtime.Serialization.Formatters.Binary; [Serializable] class Data { private int x = 13; public void Test() {    Console.WriteLine(x); } } static void Main(string[] args) { Data data = new Data(); MemoryStream stream = new MemoryStream(); BinaryFormatter formatter = new BinaryFormatter(); formatter.Serialize(stream, data); byte[] bs = stream.ToArray(); MemoryStream stream2 = new MemoryStream(bs); Data data2 = (Data)formatter.Deserialize(stream2); data2.Test(); } […]

龙生   08 Nov 2013
View Details

WebRequest之Post写法

Web.Config

  CS文件

  ashx

转自:http://www.cnblogs.com/goody9807/archive/2011/10/08/2202265.html

龙生   31 Oct 2013
View Details
1 147 148 149 177