随笔分类 -  C# .NET

摘要:解决办法:用管理员身份运行CMD,输入netsh winsock reset 并回车(注意,必须是已管理员身份运行,这个重置LSP连接)重启电脑就哦了参考文献:http://www.360doc.com/content/13/1114/16/14418795_329196484.shtml 阅读全文
posted @ 2015-12-05 09:12 doubledu 阅读(306) 评论(0) 推荐(0)
摘要:ApplicationSetting 节点的内容: http://172.27.35.10:8080/dataexchangeweb/ws/EducationService ... 阅读全文
posted @ 2015-03-09 16:40 doubledu 阅读(539) 评论(0) 推荐(0)
摘要:引自:http://blog.csdn.net/shaopengfei/article/details/36426763从C# 3.0开始提供了Distinct方法,这对于集合的使用有了更为丰富的方法,经过在网上搜索相应的资源,发现有关这方面的写的好的文章还是不少的。而且为了扩展Linq的使用不方便... 阅读全文
posted @ 2014-10-11 14:15 doubledu 阅读(4896) 评论(0) 推荐(0)
摘要:转自:http://www.cnblogs.com/liyi93/archive/2012/01/30/2332320.html虽然现在已经进入了.NET FrameWork 4.0的时代,WebService也已经逐渐被淘汰,取而代之的是WCF。但在工作中难免遇到需要兼容旧版本程序和按照以前的文档... 阅读全文
posted @ 2014-08-19 16:00 doubledu 阅读(7541) 评论(1) 推荐(0)
摘要:引自:http://www.cnblogs.com/yinpeng186/archive/2011/09/30/2196726.html 阅读全文
posted @ 2014-05-05 11:25 doubledu 阅读(157) 评论(0) 推荐(0)
摘要:很少在IIS上调试程序,因系统原因,所以不得不在IIS上预览项目和调试项目(因为只能在IIS上预览项目才能看到项目里的数据)。1、附加到进程(注意附加到进程前必须预览项目)2、选择调试项需要注意的是:Microsoft Visual Studio 2010必须在管理员模式下,如下图不然会调试不起来或... 阅读全文
posted @ 2014-04-25 11:04 doubledu 阅读(3218) 评论(1) 推荐(0)
摘要:错误原因:静态字段连接数据库内容错误(应为IntegratedSecurity=True)果然解决!来自:http://blog.csdn.net/zhang1597116/article/details/8081359 阅读全文
posted @ 2014-04-01 17:32 doubledu 阅读(419) 评论(0) 推荐(0)
摘要:引自:http://blog.163.com/wentworth0119@126/blog/static/17321924220122852720103/asp.net发布项目之后 存在".cs"文件不存在CodeBehind 指定包含与页关联的类的已编译文件的名称。该属性不能在运行时使用。 Specifies the name of the compiled file that contains the class associated with the control. This attribute is not used at run time.指定包含与页关联的类的 阅读全文
posted @ 2013-10-15 09:46 doubledu 阅读(824) 评论(0) 推荐(0)
摘要:引自:http://www.cnblogs.com/chillsrc/archive/2010/06/28/1766816.html安装完VS2010中文版之后,又安装了Silverlight4_Tools.exe之后,新建了一个Silverlight项目,随便填写了一些代码,按F5运行,出现以下错误:无法启动调试 。未安装 Silverlight Developer 运行时。请安装一个匹配版本。经过搜寻,有两种方法:1。不调试,直接运行的烂方法:对着SilverlightApplicationXXX.Web项目右键属性—》Web->去掉Silverlight的勾。只能浏览不能F5调试。 阅读全文
posted @ 2013-10-14 11:24 doubledu 阅读(304) 评论(0) 推荐(0)
摘要:在开发ASP.NET网站后台管理系统时,我们可能会遇到这样的问题:上传大于4M的文件时,会提示错误:错误信息如下: 1.异常详细信息:超过了最大请求长度。 2.引发异常的方法:Byte[] GetEntireRawContent() 3.堆栈跟踪: at System.Web.HttpRequest.GetEntireRawContent() at System.Web.HttpRequest.GetMultipartContent() at System.Web.HttpRequest.FillInFormCollection() at System.Web.HttpRequest.ge.. 阅读全文
posted @ 2013-09-03 12:29 doubledu 阅读(8608) 评论(0) 推荐(1)
摘要:【相对路径】Request.ApplicationPath/srcPath.GetDirectoryName(HttpContext.Current.Request.RawUrl)//src//XiaosheContext.Request.Path/src/Xiaoshe/Xiaoshe_New.aspxContext.Request.CurrentExecutionFilePath/src/Xiaoshe/Xiaoshe_New.aspxContext.Request.FilePath/src/Xiaoshe/Xiaoshe_New.aspxHttpContext.Current.Reque 阅读全文
posted @ 2013-08-27 10:20 doubledu 阅读(608) 评论(0) 推荐(0)
摘要:转载:http://blog.csdn.net/a125138/article/details/77420221、要使用Dictionary集合,需要导入C#泛型命名空间 System.Collections.Generic(程序集:mscorlib)2、描述 1)、从一组键(Key)到一组值(Value)的映射,每一个添加项都是由一个值及其相关连的键组成 2)、任何键都必须是唯一的 3)、键不能为空引用null(VB中的Nothing),若值为引用类型,则可以为空值 4)、Key和Value可以是任何类型(string,int,custom class 等)3、创建及初始化... 阅读全文
posted @ 2013-07-15 13:56 doubledu 阅读(421) 评论(0) 推荐(0)
摘要:在c# / ASP.net中我们可以通过使用DataTime这个类来获取当前的时间。通过调用类中的各种方法我们可以获取不同的时间:如:日期(2008-09-04)、时间(12:12:12)、日期+时间(2008-09-04 12:11:10)等。 //获取日期+时间 DateTime.Now.ToString(); // 2008-9-4 20:02:10 DateTime.Now.ToLocalTime().ToString(); // 2008-9-4 20:12:12//获取日期 DateTime.Now.ToLongDateString().ToString(); // 2008年9月 阅读全文
posted @ 2013-06-04 17:02 doubledu 阅读(244) 评论(0) 推荐(0)
摘要:转载的验证码,微改后验证码如下:CheckCode.aspx.cs代码如下:protected void Page_Load(object sender, EventArgs e) { this.CreateCheckCodeImage(GenerateCheckCode()); } private string GenerateCheckCode() { int number; char code; string checkCode = string... 阅读全文
posted @ 2012-08-31 22:01 doubledu 阅读(446) 评论(0) 推荐(0)