随笔分类 -  网络收集

通过网络收集的功能代码和小功能解决方案
Session持久化
摘要:Session持久化 关于Session持久化这方面的话题,有很多人已经写过了,但是,毕竟这是我的项目经验,更加真实,可用。 进入主题。 情景一,Session ID在客户端的状态 情景一中,saved in cookies情况 ID保存在client端的Cookies集合中 缺点是,如果client端的cookie被禁用,那么ID... 阅读全文

posted @ 2008-01-31 18:27 yangzk 阅读(317) 评论(0) 推荐(0)

C# 操作Excel的类【转载】
摘要:使用该代码要先引用Excel /*---------------------------------------------------------------- // 版权:http://XingFuStar.cnblogs.com // // 文件名: OpeareExcel // 文件功能描述: 用C#来操作Excel, // // 作者:XingFuStar // 日期:2007年8月1... 阅读全文

posted @ 2007-10-21 00:06 yangzk 阅读(361) 评论(0) 推荐(0)

用C# 更新桌面壁纸
摘要:更新桌面使用接口:IActiveDesktop Com接口不能直接在.net中使用,所以需要在.net中重新定义,接口中使用的 , 结构也需要重新定义从网上找到这样一个类 引用地址:http://www.dotnet247.com/247reference/msgs/41/205722.aspx using System; using System.Runtime.InteropServices;... 阅读全文

posted @ 2007-10-20 23:59 yangzk 阅读(799) 评论(1) 推荐(0)

获取汉字的拼音首字母
摘要:/// /// 返回字符串的首写字母字符串 /// /// 需得到首写字母的字符串 /// public String UtilIndexCode(String IndexTxt) { string _Temp=null; for(int i=0;i=0 && Convert.ToChar(OneIndexTxt)<256) return OneIndexTx... 阅读全文

posted @ 2007-10-20 23:57 yangzk 阅读(229) 评论(0) 推荐(0)

读取中文字符串长度 AND 按长度截取中文字符串中字符
摘要:public int Length(string strLen) { int l,t,c; int i; l=strLen.Length ; t=l; for( i=0;i255) { t=t+1; } } return t; } public string Substring(str... 阅读全文

posted @ 2007-10-20 23:56 yangzk 阅读(218) 评论(0) 推荐(0)

C#读硬盘序列号
摘要:using System; using System.Runtime.InteropServices; using System.Text; namespace Sunmast.Hardware { [Serializable] public struct HardDiskInfo { /// /// 型号 /// ... 阅读全文

posted @ 2007-10-20 23:55 yangzk 阅读(427) 评论(0) 推荐(0)

MD5加密
摘要:MD5加密 WinForm: public string GetMD5(string str) { byte[] b = System.Text.Encoding.Default.GetBytes(str); b = new System.Security.Cryptography.MD5CryptoServiceProvider().ComputeHash(b); S... 阅读全文

posted @ 2007-10-20 23:54 yangzk 阅读(144) 评论(0) 推荐(0)

C# DES加密/解密字符串
摘要:添加引用 using System; using System.Text; using System.Security.Cryptography; using System.IO; //默认密钥向量 private static byte[] Keys = { 0x12, 0x34, 0x56, 0x78, 0x90, 0xAB, 0xCD, 0xEF }; /// /// DES加密字符串 ... 阅读全文

posted @ 2007-10-20 23:53 yangzk 阅读(255) 评论(0) 推荐(0)

C#系统热键类
摘要:using System; using System.Runtime.InteropServices; namespace SystemHotKey { public delegate void HotkeyEventHandler(int HotKeyID); public class Hotkey : System.Windows.Forms.IMessageFilte... 阅读全文

posted @ 2007-10-20 23:52 yangzk 阅读(189) 评论(0) 推荐(0)

C#操作INI文件类
摘要:using System; using System.IO; using System.Runtime.InteropServices; using System.Text; namespace OperateIni { public class IniFile { private string IniFileName; [DllImport("kernel32")] ... 阅读全文

posted @ 2007-10-20 23:51 yangzk 阅读(260) 评论(0) 推荐(0)

使用C#获得指定打印机所支持的所有PaperSize及PaperName
摘要:所获得的PaperSize可以用在CrystalReport中设置PrintOptions.PaperSize的值,从而达到可使用自定义纸张的目的。 using System; using System.Security; using System.Drawing.Printing; using System.Runtime.InteropServices; namespa... 阅读全文

posted @ 2007-10-20 16:29 yangzk 阅读(2083) 评论(0) 推荐(0)

C#让程序只运行一次实例
摘要:添加引用 Code highlighting produced by Actipro CodeHighlighter (freeware) http://www.CodeHighlighter.com/ -->using System.Reflection; using System.Runtime.InteropServices; using System.Diagnostics; 调用... 阅读全文

posted @ 2007-10-13 21:14 yangzk 阅读(337) 评论(0) 推荐(0)

导航