摘要: 接触Ajax,那时候的Ajax支持还不是很好,都要涉及底层,没有现成的框架给你调用。现在把常见的问题列举如下。1、编码问题注意AJAX要取的文件是UTF-8编码的。GB2312编码传回BROWSE后中文会乱码。如果用VBScript的话还可以转化,但是VBScript只有IE支持。所以,选择UTF-8编码是一劳永逸的办法。2、清除服务器端文件的缓存。当用XMLHTTP取回一个服务器端的文件,文件会... 阅读全文
posted @ 2009-05-22 20:36 起源 阅读(586) 评论(3) 推荐(0)
摘要: 1、DateTime 数字型 System.DateTime currentTime=new System.DateTime();   1.1 取当前年月日时分秒 currentTime=System.DateTime.Now;   1.2 取当前年 int 年=currentTime.Year;   1.3 取当前月 int 月=currentTime.Month;   1.4 取当前日 int... 阅读全文
posted @ 2009-05-22 20:16 起源 阅读(151) 评论(0) 推荐(0)
摘要: 自定义SOAP标题可以限制调用服务的用户范围1usingSystem;2usingSystem.Web;3usingSystem.Web.Services;4usingSystem.Web.Services.Protocols;56[WebService(Namespace="http://livebaby.cn")]7[WebServiceBinding(ConformsTo=WsiProfil... 阅读全文
posted @ 2009-05-22 20:13 起源 阅读(216) 评论(0) 推荐(0)
摘要: 在多线程或单线程任务中,让线程带传入参数一直是个麻烦的问题,通常有种方法就是以类,对像的变量来传参数,这种方法理解上很简单不过在某些场合使用很麻烦,这里就不介绍了,我们主要介绍一种.NET2.0中新增加的带参数运行线程的方法,示例程序如下:ParameterizedThreadStart ParStart = new ParameterizedThreadStart(ThreadMethod); ... 阅读全文
posted @ 2009-05-22 15:38 起源 阅读(748) 评论(3) 推荐(0)
摘要: 未将对象引用设置到对象的实例1、DataReader从数据库中取数据因为没有取到数据或取到的数据为空:比如,查询name="123",但是没有该数据2、Session对象为空:这个因为重编译或者重启iis都会造成3、没有使用new初始化对象:这个遇到的比较少4、使用了没有赋值的字符串变量。5、ViewState对象为Null6、对控件赋文本值的时候,值不存在。7、使用Request.QuerySt... 阅读全文
posted @ 2009-05-22 15:36 起源 阅读(1192) 评论(0) 推荐(0)
摘要: 在"实体类代码生成器3"中,用户可以使用C#代码来动态生成一些参数,比如代码类名生成规则,表名生成规则,初始化规则等.而要调用这些代码显然需要对代码进行运行时动态编译,幸好C#有了"万能"的反射系统,可以让我们轻松动态编译代码并调用.OK,现在详细了解下"实体类代码生成器"中的动态编译类,首先定义一个RunnerMethod对象,用来保存和方法有关的信息:C#代码 usingSystem; usi... 阅读全文
posted @ 2009-05-22 15:21 起源 阅读(822) 评论(1) 推荐(0)
摘要: C#Control内 public delegate void SetExRichReciveHandel(string str); public void SetExRichRecive(string str) { if (this.exRichRecive.InvokeRequired) { SetExRichReciveHandel SPBH = new SetExRichReciveHan... 阅读全文
posted @ 2009-05-22 11:52 起源 阅读(214) 评论(0) 推荐(0)
摘要: usingSystem;usingSystem.Collections.Generic;usingSystem.Text;usingSystem.Net;usingSystem.Net.Sockets;usingSystem.Windows.Forms;usingSystem.Diagnostics;usingSystem.Runtime.InteropServices;namespaceClie... 阅读全文
posted @ 2009-05-22 11:45 起源 阅读(188) 评论(0) 推荐(0)
摘要: staticvoidMain(string[]args){//打开登录窗口LoginFormlg=newLoginForm();if(lg.ShowDialog()==DialogResult.OK){Application.Run(newMainForm());//打开你指定的窗口}}登录窗口(LoginForm)中在你完成密码验证代码后加上this.DialogResult=DialogRes... 阅读全文
posted @ 2009-05-22 11:43 起源 阅读(1051) 评论(3) 推荐(0)
摘要: <script language=javascript>function getUrl(URL) { var xmlhttp = new ActiveXObject("microsoft.xmlhttp"); xmlhttp.Open("GET",URL, false); try { xmlhttp.Send(); } catch(e){} finally { var result =... 阅读全文
posted @ 2009-05-22 11:37 起源 阅读(530) 评论(1) 推荐(0)