![](https://img-blog.csdnimg.cn/20201014180756754.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
C#
晨土飞扬
这个作者很懒,什么都没留下…
展开
-
C# winfrom WebRequest获取html网页信息 引用using
private string GetHtmlinfo(string PageUrl) { WebRequest request = WebRequest.Create(PageUrl); WebResponse response = request.GetResponse(); Stream resSt原创 2011-12-22 13:04:17 · 2289 阅读 · 0 评论 -
C#利用Web Service实现短信发送
通过编程方式实现短信息的发送对很多人来说是一件比较烦杂的事情,目前一般的解决方法是通过计算机和手机的连线,通过可对手机编程的语言编写相关的手机短信息程序来实现,而这种方法对于一般人来说是很难达到的,因为此种方法不仅要有很多必备的硬件设备,也还需懂得手机编程的相关知识。本文就来探讨一下另外一种通过Visual C#发送短信息的简单实现方法,这种方法在实现过程中比我们想象的要简单许多,只需拥有Visu转载 2012-03-29 10:22:22 · 936 阅读 · 0 评论 -
C#网络爬虫
下面链接就是一个c#写的网络爬虫,上面是翻译版 ,下面是英文原版http://blog.csdn.net/wangkun9999/archive/2007/05/02/1594496.aspxhttp://www.codeproject.com/cs/internet/Crawler.asp另外,爬虫抓下来的东西要进行分析是必然的了,但c#中好像没有HTML解析器,特别是对那种不太转载 2012-04-06 18:10:39 · 3201 阅读 · 0 评论 -
Ctrl组合键的ASCii
Ctrl组合键ASCII码 ^Z代表Ctrl+z ASCII值 控制字符 ASCII值 控制字符 ASCII值 控制字符 ASCII值 控制字符 0(00) NULL 8(08) ^H 16(10) ^P 24(18) ^X1(01)转载 2012-03-22 09:43:35 · 2960 阅读 · 1 评论 -
C# 调用cmd命令 调用dos命令
private void button3_Click(object sender, EventArgs e) { if (dq1ip.Text.Trim()!="") { Execute("mstsc /v:"+dq1ip.Text); } }转载 2012-05-25 11:58:11 · 890 阅读 · 0 评论 -
c# 获取不重复字符串数组
using System;using System.Linq;//有了Linq很多事变的简单了namespace 排除重复行{ class Program { static void Main(string[] args) { String[] a ={ "1", "1", "2", "1", "1", "3", "1转载 2012-06-25 10:01:18 · 3134 阅读 · 0 评论 -
C# 获取AD组中的用户信息
DirectoryEntry de = new DirectoryEntry("LDAP://" + "域名", "用户名", "密码", AuthenticationTypes.Secure); DirectorySearcher ds = new DirectorySearcher(); ds.SearchRoot = de; /原创 2012-06-25 15:22:00 · 8442 阅读 · 0 评论 -
合并MP3
void hebingmp3(string aaa) { FileStream AddStream = new FileStream(System.Web.HttpContext.Current.Request.PhysicalApplicationPath+"\\ceshi\\yanzhengma.mp3", FileMode原创 2012-06-25 10:06:12 · 1264 阅读 · 1 评论 -
C# 创建目录 写入文本 基础文本操作
创建目录 void CrateDir(string path) { System.IO.Directory.CreateDirectory(path); } CrateDir(@"C:\windows\aaa");写入文件 void shuchu(string path,string info)原创 2012-06-25 10:12:40 · 747 阅读 · 0 评论 -
C# 获取AD用户信息
DirectoryEntry de = new DirectoryEntry("LDAP://" + "域名", "用户名", "密码", AuthenticationTypes.Secure); DirectorySearcher ds = new DirectorySearcher(); ds.SearchRoot = de; ds.Filt原创 2012-06-25 12:43:50 · 1402 阅读 · 0 评论 -
美化winfrom窗体
[System.Runtime.InteropServices.DllImport("user32")] private static extern bool AnimateWindow(IntPtr hwnd, int dwTime, int dwFlags); private const int AW_HOR_POSITIVE = 0x0001;//从左向右转载 2012-08-21 17:38:03 · 1974 阅读 · 0 评论 -
牛牛牛!正则阿拉伯数字变中国大写
using System;using System.Text.RegularExpressions; class Program{ // 把阿拉伯数字的金额转换为中文大写数字 static string ConvertToChinese(double x) { string s = x.ToString("#L#E#D#C#K#E#D#C#J#E#D#C转载 2013-07-07 21:47:22 · 2043 阅读 · 0 评论 -
C#打印datatable
#region Members //成员 public String printName = String.Empty; public Font prtTextFont = new Font("Verdana", 10); public Font prtTitleFont = new Font("宋体", 10); priva转载 2013-07-14 22:48:12 · 3697 阅读 · 0 评论 -
datatable 数据替换 内容替换
1234567891011DataTable dt = CreateDataTable();//获取DataTable dt=dt.AsEnumerable().Select(a => {原创 2013-07-23 21:43:44 · 1838 阅读 · 0 评论 -
C# Winfrom 修改文件信息内容
string lod = Application.StartupPath + "\\logs\\mongod.log"; FileInfo f = new FileInfo(lod); FileStream fs = f.Open(FileMode.Open); StreamReader sr = new StreamR原创 2012-03-07 12:00:00 · 1183 阅读 · 0 评论 -
异步回调 主线程等待子线程结束
static TimeSpan waitTime = new TimeSpan(0, 0, 5); static WaitHandle[] waitHandles = new WaitHandle[] { new AutoResetEvent(false) //new AutoResetEvent(false) }; Thread翻译 2012-02-14 12:43:04 · 3392 阅读 · 0 评论 -
所有程序员必须收藏的网站
http://www.gotapi.com/语言:英语简介:HTML,CSS,XPATH,XSL,JAVASCRIPT等API的查询网站。http://www.w3schools.com/语言:英语简介:W3C制定的标准诸如XML,HTML,XSL等等的在线学习教程。http://www.xml.org.cn/语言:中文简介:可以说是XML的中国官方网吧。W3C标准转载 2011-12-16 12:30:33 · 783 阅读 · 0 评论 -
c#winform获得银盘序列号和cpu序列号
添加引用System.Management;引用命名空间 using System.Management; public string GetDiskVolumeSerialNumber() { ManagementClass mc = new ManagementClass("Win32_NetworkAdapterConfi原创 2011-12-26 12:27:47 · 814 阅读 · 0 评论 -
C# Win32API类
class Win32API { [DllImport("User32.dll")] //User32.dll是Windows操作系统的核心动态库之一 public static extern int FindWindow(string lpClassName, string lpWindowName);原创 2012-01-09 14:14:36 · 1203 阅读 · 0 评论 -
C# winfrom 获取按键信息
datagridview 中 e.KeyChar.ToString()textbox中 e.KeyValue (ascⅡ值)原创 2012-01-10 17:15:22 · 1796 阅读 · 0 评论 -
C# 控制小键盘锁 numlock
[DllImport("user32.dll")] static extern void keybd_event(byte bVk, byte bScan, int dwFlags, int dwExtraInfo); const int KEYEVENTF_EXTENDEDKEY = 0x1; const int KEYEVENTF_KEYU原创 2012-01-11 09:58:13 · 2841 阅读 · 1 评论 -
获取小键盘numlock 当前状态信息
[DllImport("user32.dll")] public static extern short GetKeyState(int keyCode); public Form2(string SQl) { bool NumLock = (((ushort)GetKeyState(0x90)) & 0xfff原创 2012-01-11 10:28:41 · 2063 阅读 · 0 评论 -
winfrom 控制窗体间相互传递数据
方法一在子窗体中自定义一个构造函数,参数类型是主窗体,当要显示子窗体的时候,就用这个构造函数来实例化子窗体,然后把this指针传进去。代码如下:主窗体.cspublicclass frmMain:Form{...frmControl controlForm=new frmControl(this);controlForm.Show();}复制转载 2012-01-12 09:21:37 · 849 阅读 · 0 评论 -
C# 添加,修改,删除Xml节点
private void AddXml(string image, string title) { XmlDocument xmlDoc = new XmlDocument(); xmlDoc.Load(Server.MapPath("../flash/dati.xml")); XmlNode root = xmlDoc.Selec转载 2012-02-03 14:51:59 · 514 阅读 · 0 评论 -
asp GridView自己创建表头
protected void GridView1_RowCreated(object sender, GridViewRowEventArgs e) { if (e.Row.RowType== DataControlRowType.Header) { TableCellCollection Tcl = e.Row.Cells;原创 2012-02-03 17:41:17 · 795 阅读 · 0 评论 -
C# 单问号(?)和双问号(??)用法。
1、单问号(?)作用:用于给变量设初化的时候,给变量(int类型)赋为null值,而不是0。例子:public int a; //默认值为0public int ?b; //默认值为null参考:http://msdn.microsoft.com/zh-cn/library/1t3y8s4s.aspx2、双问号(??)作用:用于判断并赋值,先判断当前变量是否为null,转载 2012-02-03 11:44:04 · 5656 阅读 · 0 评论 -
Regex分离字符串
using System.Text.RegularExpressions; string[] a = Regex.Split("123456!!!123456", "!!!");原创 2012-01-04 11:52:02 · 577 阅读 · 0 评论 -
C# 可逆加密类
using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.IO;using System.Security.Cryptography;namespace fromArgs{ class SymmetricMethod {转载 2012-01-04 15:36:35 · 502 阅读 · 0 评论 -
winfrom SocketAsyncEventArgs 跨线程访问控件 调试退出
Control.CheckForIllegalCrossThreadCalls = false;有人会么?这个问题在winfrom里面的。。。。还有这个更好的方法 delegate void FunDelegate(string str); private void FunStart(object obj)//线程中调用的方法 FunStart("1原创 2012-01-05 14:00:27 · 844 阅读 · 0 评论 -
datatable 内容替换 数据替换
datatable 内容替换 数据替换DataTable dt = CreateDataTable();//获取DataTable dt=dt.AsEnumerable().Select(a => { fo原创 2013-07-23 21:45:29 · 4664 阅读 · 0 评论