摘要:
usingSystem;usingSystem.Collections.Generic;usingSystem.Linq;usingSystem.Text;namespaceRegister{publicclassHttpClass{privateSystem.Net.HttpWebRequestRequest=null;privateSystem.Net.WebResponseResponse=null;privateSystem.IO.StreamStream=null;privateSystem.IO.StreamReaderRead=null;privateSystem.Byte[]B 阅读全文
摘要:
1.TREE表:[strID] [int] IDENTITY(1,1) NOT NULL,[strName] [nvarchar](50) NOT NULL,2.SubInfoCREATE TABLE [dbo].[SubInfo]([SuBID] [int] NOT NULL,[SubTreeID] [nvarchar](max) NULL,SQL语句为:select a.strID,a.strName from Tree as a where exists(select * from SubInfo where charindex(cast(a.strID as varchar(max)) 阅读全文
摘要:
public void valid() { string echostr = Request.QueryString["echostr"]; if (!string.IsNullOrEmpty(echostr)) { if (checkSignature()) { Response.Write(echostr); Response.End(); } ... 阅读全文
摘要:
using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Data;using System.Text;using System.Text.RegularExpressions;using System.IO;using System.Runtime.Serialization.Json;namespace TMFHTong{ public class JsonHelper { /// /// 获取json中的指定值 ... 阅读全文
摘要:
XMLHelper.csusing System;using System.Data;using System.Xml; using System.Collections.Specialized; using System.Diagnostics;using System.Collections;namespace TMFHTong{/// /// Summary description for XmlHelper./// public class XmlHelper{private XmlHelper(){} #region /*******************************. 阅读全文
摘要:
//在项目里添加一个"全局应用程序类(GlobalApplicationClass)",在里面写这样的代码:publicclassGlobal:System.Web.HttpApplication{staticTimerBuildStaticPagesTimer;staticobjectlocker=newobject();staticintcount;protectedvoidApplication_Start(objectsender,EventArgse){//doublechecklock...if(BuildStaticPagesTimer==null){lock 阅读全文
摘要:
using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Web.UI;using System.IO;namespace test{ public class PageCreateRenderPage : System.Web.UI.Page { public string strFileName = "default.html"; public string redirectURL = null; publi... 阅读全文
摘要:
经过几天研究网上的代码和谢灿大神的帮忙,今天终于用C#实现了微信公众号群发消息,现在整理一下。总体思路:1.首先必须要在微信公众平台上申请一个公众号。 2.然后进行模拟登陆。(由于我对http传输原理和编程不是特别懂,在模拟登陆的地方,不是特别清楚,希望有大神指教) 3.模拟登陆后会获得一个token(令牌)和cookie。 4.因为模拟登陆后相当于就进入了微信公众平台,在这个里面就可以抓取到需要的数据,如公众好友的昵称,fakeId。其中的fakeid非常重要,因为传输数据必须要知道 对方的fakeid。 5.知道对方的fa... 阅读全文
摘要:
framework4.0 可这样C:\Inetpub\AdminScripts>cd C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319>aspnet_regiis.exe -iStart installing ASP.NET (4.0.30319)........Finished installing ASP.NET (4.0.30319).2.0解决办法:在CMD中进入目录C:\WINDOWS\Microsoft.NET\Framework\v2. 阅读全文
摘要:
protectedstringGetWebContent(stringurl){Streamoutstream=null;Streaminstream=null;StreamReadersr=null;HttpWebResponseresponse=null;HttpWebRequestrequest=null;//要注意的这是这个编码方式,还有内容的Xml内容的编码方式Encodingencoding=Encoding.GetEncoding("GBK");byte[]data=encoding.GetBytes(url);//准备请求,设置参数request=WebRe 阅读全文