摘要:
public class XmlSocket { //异步socket诊听 // Incoming data from client.从客户端传来的数据 public static string data = null; // Thread signal.线程 用一个指示是否将初始状态设置为终止的布尔值初始化 ManualResetEvent 类的新实例。 public static ManualResetEvent allDone = new ManualResetEvent(false); //static void Main(string[] args) //{ // StartList 阅读全文
摘要:
/// <summary> /// 十进制转换为二进制 /// </summary> /// <param name="x"></param> /// <returns></returns> public static string DecToBin(string x) { string z = null; int X = Convert.ToInt32(x); int i = 0; long a, b = 0; while (X > 0) { a = X%2; X = X/2; b = b + 阅读全文
摘要:
//数据库 public class GF_DA { /// <summary> /// 执行SQL语句 sConnStr 连接字符串,sql执行的sql命令 返回第一行第一列 /// </summary> /// <param name="sConnStr"></param> /// <param name="sql"></param> /// <returns></returns> public static object ExecSQL(string s 阅读全文
摘要:
/// <summary> /// 获得页码显示链接 /// </summary> /// <param name="curPage">当前页数</param> /// <param name="countPage">总页数</param> /// <param name="url">超级链接地址</param> /// <param name="extendPage">周边页码显示个数上限</para 阅读全文
摘要:
//获取部分 public class GF_GET { /// <summary> /// 根据坐标点获取屏幕图像 /// </summary> /// <param name="x1">左上角横坐标</param> /// <param name="y1">左上角纵坐标</param> /// <param name="x2">右下角横坐标</param> /// <param name="y2">右下角 阅读全文
摘要:
//判断部分 public class GF_IsOk { /// <summary> /// 判读是否是IP地址 /// </summary> /// <param name="in_str"></param> /// <returns></returns> public static bool IsIPStr(string in_str) { IPAddress ip; return IPAddress.TryParse(in_str, out ip); } /// <summary> 阅读全文
摘要:
//读写INI public class GF_INI { [DllImport("kernel32")] private static extern long WritePrivateProfileString(string section, string key, string val, string filePath); [DllImport("kernel32")] private static extern int GetPrivateProfileString(string section, string key, string def, S 阅读全文
摘要:
//文件操作 public class GF_File { /// <summary> /// 写日志文件 /// </summary> /// <param name="sPath"> 年月 例 2011-04</param> /// <param name="sFileName">月日 例 04-22</param> /// <param name="content">时间+ 内容</param> /// <returns> 阅读全文
摘要:
//网络部分 public class GF_Network { /* * * * */ /// <summary> /// 获取IP地址 返回第一个 /// </summary> /// <returns></returns> public static string getIP_This() { IPHostEntry hostInfo = Dns.GetHostEntry(Dns.GetHostName()); IPAddress[] address = hostInfo.AddressList; if (address.Length == 阅读全文
摘要:
using System;using System.Collections.Generic;using System.Text;using Microsoft.Win32; //对注册表操作using System.Collections; //使用Arraylistusing System.Security.Cryptography;//加密解密using System.IO; //文件操作using System.Runtime.InteropServices;//调用DLL DllImportusing System.Management; //获取硬件信息using System.Ne 阅读全文