資源簡(jiǎn)介
c#微信通訊的Web平臺(tái),實(shí)現(xiàn)微信相互發(fā)送信息,同步微信和數(shù)據(jù)庫(kù)關(guān)注人員信息,微信公共號(hào)上傳文檔,編輯新聞,編輯文檔資料

代碼片段和文件信息
using?System;
using?System.Collections.Generic;
using?System.Linq;
using?System.Text;
using?System.Security.Cryptography;
namespace?WebCommon
{
????///?
????///?DES加密/解密類(lèi)。
????///?
????public?static?class?DESEncrypt
????{
????????#region?========加密========
????????///?
????????///?加密
????????///?
????????///?
????????///?
????????public?static?string?Encrypt(string?Text)
????????{
????????????return?Encrypt(Text?“pdptyunwei“);
????????}
????????///??
????????///?加密數(shù)據(jù)?
????????///? ?
????????///??
????????///??
????????///? ?
????????public?static?string?Encrypt(string?Text?string?sKey)
????????{
????????????DESCryptoServiceProvider?des?=?new?DESCryptoServiceProvider();
????????????byte[]?inputByteArray;
????????????inputByteArray?=?Encoding.Default.GetBytes(Text);
????????????des.Key?=?ASCIIEncoding.ASCII.GetBytes(System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(sKey?“md5“).Substring(0?8));
????????????des.IV?=?ASCIIEncoding.ASCII.GetBytes(System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(sKey?“md5“).Substring(0?8));
????????????System.IO.MemoryStream?ms?=?new?System.IO.MemoryStream();
????????????CryptoStream?cs?=?new?CryptoStream(ms?des.CreateEncryptor()?CryptoStreamMode.Write);
????????????cs.Write(inputByteArray?0?inputByteArray.Length);
????????????cs.FlushFinalBlock();
????????????StringBuilder?ret?=?new?StringBuilder();
????????????foreach?(byte?b?in?ms.ToArray())
????????????{
????????????????ret.AppendFormat(“{0:X2}“?b);
????????????}
????????????return?ret.ToString();
????????}
????????#endregion
????????#region?========解密========
????????///?
????????///?解密
????????///?
????????///?
????????///?
????????public?static?string?Decrypt(string?Text)
????????{
????????????return?Decrypt(Text?“pdptyunwei“);
????????}
????????///??
????????///?解密數(shù)據(jù)?
????????///? ?
????????///??
????????///??
????????///? ?
????????public?static?string?Decrypt(string?Text?string?sKey)
????????{
????????????DESCryptoServiceProvider?des?=?new?DESCryptoServiceProvider();
????????????int?len;
????????????len?=?Text.Length?/?2;
????????????byte[]?inputByteArray?=?new?byte[len];
????????????int?x?i;
????????????for?(x?=?0;?x?????????????{
????????????????i?=?Convert.ToInt32(Text.Substring(x?*?2?2)?16);
????????????????inputByteArray[x]?=?(byte)i;
????????????}
????????????des.Key?=?ASCIIEncoding.ASCII.GetBytes(System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(sKey?“md5“).Substring(0?8));
????????????des.IV?=?ASCIIEncoding.ASCII.GetBytes(System.Web.Securi
?屬性????????????大小?????日期????時(shí)間???名稱(chēng)
-----------?---------??----------?-----??----
?????文件?????373248??2012-12-01?23:22??微信消息加密\YQTYW\WebCommon\bin\Debug\Newtonsoft.Json.dll
?????文件??????15872??2015-11-26?14:46??微信消息加密\YQTYW\WebCommon\bin\Debug\WebCommon.dll
?????文件??????28160??2015-11-26?14:46??微信消息加密\YQTYW\WebCommon\bin\Debug\WebCommon.pdb
?????文件??????12288??2015-11-26?14:46??微信消息加密\YQTYW\WebCommon\bin\Debug\WebDAL.dll
?????文件??????28160??2015-11-26?14:46??微信消息加密\YQTYW\WebCommon\bin\Debug\WebDAL.pdb
?????文件??????18432??2015-11-26?14:46??微信消息加密\YQTYW\WebCommon\bin\Debug\WebDB.dll
?????文件??????46592??2015-11-26?14:46??微信消息加密\YQTYW\WebCommon\bin\Debug\WebDB.pdb
?????文件??????14336??2015-11-26?14:46??微信消息加密\YQTYW\WebCommon\bin\Debug\WebModel.dll
?????文件???????7680??2015-11-26?14:46??微信消息加密\YQTYW\WebCommon\bin\Debug\WebModel.pdb
?????文件???????3517??2015-11-17?09:39??微信消息加密\YQTYW\WebCommon\DESEncrypt.cs
?????文件???????1329??2015-11-25?11:44??微信消息加密\YQTYW\WebCommon\JsonData.cs
?????文件???????6045??2015-11-26?14:46??微信消息加密\YQTYW\WebCommon\obj\Debug\DesignTimeResolveAssemblyReferencesInput.cache
?????文件????????707??2015-11-26?14:46??微信消息加密\YQTYW\WebCommon\obj\Debug\WebCommon.csproj.FileListAbsolute.txt
?????文件??????21576??2015-11-26?14:46??微信消息加密\YQTYW\WebCommon\obj\Debug\WebCommon.csprojResolveAssemblyReference.cache
?????文件??????15872??2015-11-26?14:46??微信消息加密\YQTYW\WebCommon\obj\Debug\WebCommon.dll
?????文件??????28160??2015-11-26?14:46??微信消息加密\YQTYW\WebCommon\obj\Debug\WebCommon.pdb
?????文件???????1350??2015-11-10?11:40??微信消息加密\YQTYW\WebCommon\Properties\AssemblyInfo.cs
?????文件???????3221??2015-11-25?11:40??微信消息加密\YQTYW\WebCommon\WebCommon.csproj
?????文件???????8416??2015-11-16?09:52??微信消息加密\YQTYW\WebCommon\WxMenuJson.cs
?????文件???????3056??2015-11-26?11:31??微信消息加密\YQTYW\WebCommon\WxUserJson.cs
?????文件?????373248??2012-12-01?23:22??微信消息加密\YQTYW\WebDAL\bin\Debug\Newtonsoft.Json.dll
?????文件??????12288??2015-11-26?14:46??微信消息加密\YQTYW\WebDAL\bin\Debug\WebDAL.dll
?????文件??????28160??2015-11-26?14:46??微信消息加密\YQTYW\WebDAL\bin\Debug\WebDAL.pdb
?????文件??????18432??2015-11-26?14:46??微信消息加密\YQTYW\WebDAL\bin\Debug\WebDB.dll
?????文件??????46592??2015-11-26?14:46??微信消息加密\YQTYW\WebDAL\bin\Debug\WebDB.pdb
?????文件??????14336??2015-11-26?14:46??微信消息加密\YQTYW\WebDAL\bin\Debug\WebModel.dll
?????文件???????7680??2015-11-26?14:46??微信消息加密\YQTYW\WebDAL\bin\Debug\WebModel.pdb
?????文件???????2492??2015-11-25?08:20??微信消息加密\YQTYW\WebDAL\MenusDAL.cs
?????文件???????6005??2015-11-26?11:25??微信消息加密\YQTYW\WebDAL\MessageDAL.cs
?????文件????????884??2015-11-25?16:55??微信消息加密\YQTYW\WebDAL\MobileFileDAL.cs
............此處省略504個(gè)文件信息
評(píng)論
共有 條評(píng)論