摘要: 上代码 1 using System; 2 using System.Collections.Generic; 3 using System.IO; 4 using System.Linq; 5 using System.Web; 6 using System.Web.UI; 7 using System.Web.UI.WebControls; 8 using System.Web.Security; 9 10 public partial class wx_Default : System.Web.UI.Page11 {12 protected void Page_Load(obje... 阅读全文
posted @ 2013-11-26 16:02 duanyong 阅读(317) 评论(0) 推荐(0) 编辑
摘要: 1 context = HttpContext.Current; 2 string ServerPath = HttpContext.Current.Server.MapPath("~"); 3 string FilePath = ServerPath + "\\wx\\weixin.txt"; 4 if (File.Exists(FilePath)) 5 { 6 File.Delete(FilePath); 7 } 8 string strCon = Re... 阅读全文
posted @ 2013-11-26 15:21 duanyong 阅读(695) 评论(0) 推荐(0) 编辑
摘要: 1.如果是为了验证微信接口的token是否通过, 将valid注释去掉 2.如果要返回给用户值, 注释掉valid作者:石世特出处:http://www.cnblogs.com/TivonStone/ 1 2 3 using System; 4 using System.Web; 5 6 public class WeixinInterface : IHttpHandler 7 { 8 HttpContext context = null; 9 string postStr = ""; 10 public void ProcessRequ... 阅读全文
posted @ 2013-11-26 09:20 duanyong 阅读(358) 评论(0) 推荐(0) 编辑
摘要: 结构类型的构造函数与类的构造函数类似,但是 structs 不能包含显式默认构造函数,因为编译器将自动提供一个构造函数。 此构造函数会将 struct 中的每个字段初始化为默认值。有关更多信息,请参见Default Values Table (C# Reference)。 然而,只有当 struct 用 new 实例化时,才会调用此默认构造函数。 例如,下面的代码使用 Int32 的默认构造函数,因此您可以确信整数已初始化:int i = new int();Console.WriteLine(i);不过,下面的代码却会导致编译器错误,因为它没有使用 new,而且尝试使用尚未初始化的对象:in 阅读全文
posted @ 2011-01-30 01:04 duanyong 阅读(1410) 评论(0) 推荐(0) 编辑
摘要: 结构与类共享大多数相同的语法,但结构比类受到的限制更多:在结构声明中,除非字段被声明为 const 或 static,否则无法初始化。结构不能声明默认构造函数(没有参数的构造函数)或析构函数。结构在赋值时进行复制。将结构赋值给新变量时,将复制所有数据,并且对新副本所做的任何修改不会更改原始副本的数据。在使用值类型的集合(如 Dictionarystring, myStruct)时,请务必记住这一点。结构是值类型,而类是引用类型。与类不同,结构的实例化可以不使用 new 运算符。结构可以声明带参数的构造函数。一个结构不能从另一个结构或类继承,而且不能作为一个类的基。所有结构都直接继承自Sys 阅读全文
posted @ 2011-01-30 00:31 duanyong 阅读(160) 评论(0) 推荐(0) 编辑
摘要: usingSystem.Drawing;publicstaticImageGenerateThumbImage(ImageoriginalImage,intlimitedSize){if(limitedSize 20){thrownewInvalidObjectException("limitedSize");}intheight = originalImage.Height;intwidth = originalImage.Width;if(height limitedSize || width limitedSize){intnewHeight, newWidth;if(hei 阅读全文
posted @ 2011-01-15 17:59 duanyong 阅读(864) 评论(0) 推荐(0) 编辑
摘要: 一、您可以使用 System.Drawing.Image 类System.Drawing.Imageimg = System.Drawing.Image.FromFile(Server.MapPath("example.gif"));int width= img.Width;int height = img.Height;img.Dispose();Image 的名称空间是:System.Drawing但是这里我们却不能在导入名称空间后使用 Image时省略 System.Drawing,因为这会和 System.Web.UI.WebControls 的 Image 产生混淆。可以处理 BMP 阅读全文
posted @ 2011-01-13 18:40 duanyong 阅读(528) 评论(0) 推荐(0) 编辑
摘要: 比较好的情况是逻辑结构与前面的树型物理结构相吻合,也就是说:主页链接向所有的频道主页主页一般不直接链接向内容页,除非是你非常想推的几个特殊的页所有频道主页都连向其他频道主页频道主页都连回网站主页频道主页也连向属于自己本身频道的内容页频道主页一般不连向属于其他频道的内容页所有内容页都连向网站主页所有内容页都连向自己的上一级频道主页内容页可以连向同一个频道的其他内容页内容页一般不连向其他频道的内容页内... 阅读全文
posted @ 2010-03-16 22:26 duanyong 阅读(136) 评论(0) 推荐(0) 编辑
摘要: 程序代码Module myModule Sub Main() Dim rand = New System.Random() Dim i As Integer Console.WriteLine("方法名称:next();功能描述:返回一个0~2147483647之间的整数") For i = 0 To 9 Console.WriteLine("返回一个0~2147483647之间的整数[" + i.ToString + "]:" + rand.next().ToString) Next i Console.WriteLine() Console.WriteLine("方法名称:ne 阅读全文
posted @ 2009-09-03 23:44 duanyong 阅读(901) 评论(0) 推荐(0) 编辑
摘要: 如下得方式可以加入控件1. 如果你再页面中已经注册了控件,就像:%@ Register Src="../UserControl/UploadImg_WebUserControl.ascx"TagName="UploadImg_WebUserControl" TagPrefix="uc1" %你可以:UserControlName obj = new UserControlName(); //creating object for User controlPanel1.Controls.Add(obj)2. 如果在页面中还没有注册,那么你需要这样去做:UserControl xy = new 阅读全文
posted @ 2009-09-03 10:22 duanyong 阅读(308) 评论(0) 推荐(1) 编辑
摘要: 软件环境创建ASP.NET MVC 应用程序, 你需要安装Visual Studio 2008 或者 Visual Web Developer 2008安装在你得电脑上( Visual Studio 2008中得一些高级功能,在Visual WebDeveloper将会缺失)。获取相关软件请访问以下地址: http://www.asp.net/downloads/essential/使用Visual Studio 2008 或者 Visual Web Developer 2008创建ASP.NET MVC 应用程序,你必须确保升级至Service Pack 1 ,否则将不能创建应用程序。ASP 阅读全文
posted @ 2009-08-22 22:59 duanyong 阅读(174) 评论(0) 推荐(0) 编辑