01 2015 档案
With as 递归查询
摘要:use TESTcreate table Provinces( pro_Id int primary key identity(1,1), pro_Name nvarchar(255), pro_Code nvarchar(8), pro_PId int) exec sp_r...
阅读全文
ServiceController1
摘要:using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;u...
阅读全文
Winform TreeView 节点拖动
摘要:private void treeView_ItemDrag(object sender, ItemDragEventArgs e) { TreeNode dragNode = e.Item as TreeNode; DoDr...
阅读全文
Winform ListView 元素拖动
摘要://ListView 属性 /* AllowDrop : True */ ListView objLVDrag; private void listView_DragDrop(object sender, DragEventArgs e) { ...
阅读全文
提示文字样式定义
摘要:private void toolTip1_Draw(object sender, DrawToolTipEventArgs e) { // 自定义背景 e.Graphics.FillRectangle(SystemBrushes.Activ...
阅读全文
窗体闪烁
摘要:/// /// lashes the specified window one time. It does not change the active state of the window. /// /// A handle to the window...
阅读全文
Ini文件操作函数
摘要:/// /// Copies a string into the specified section of an initialization file. /// /// The name of the section to which the str...
阅读全文
移动文件
摘要:/// /// Moves an existing file or directory, including its children, with various move options. /// The MoveFileWithProgress function i...
阅读全文
文件路径遍历
摘要:private void DeeperDirectory(string path) { FileSystemInfo[] fsi = new DirectoryInfo(path).GetFileSystemInfos(); foreach ...
阅读全文
边缘探测
摘要:Color C1, C2, C3, C4; int r1, r2, r3, r4, g1, g2, g3, g4, b1, b2, b3, b4, rx, ry, gx, gy, bx,...
阅读全文
马赛克效果
摘要:Color C; int r, g, b, rV, gV, bV, rT, gT, bT, y, z; Bitmap bmp = new Bitmap(pictureBox1.Image);//创建Bitmap对象 Bitmap t...
阅读全文
柔化效果
摘要:Bitmap bmp = new Bitmap(pictureBox1.Image); int Height = bmp.Height; int Width = bmp.Width; Bitmap tmp = (Bitmap)bmp...
阅读全文
锐化效果
摘要:Bitmap bmp = new Bitmap(pictureBox1.Image); //创建Bitmap对象 Bitmap tmp = (Bitmap)bmp.Clone();//创建Bitmap对象 int height = tmp.Height;...
阅读全文
扭曲效果
摘要:///283,191 Bitmap bmp = new Bitmap(pictureBox1.Image);//创建Bitmap对象 using (Graphics g = pictureBox2.CreateGraphics()) ...
阅读全文
黑白效果
摘要:Bitmap bmp = new Bitmap(pictureBox1.Image); int height = bmp.Height; int width = bmp.Width; Bitmap tmp = new Bitma...
阅读全文
光照效果
摘要:private const float BRIGHTNESS = 220.0F; Graphics g = this.pictureBox2.CreateGraphics(); g.Clear(Color.White); Bitmap bmp = new ...
阅读全文
积木效果
摘要:int avg, iPixel; Color C, newC; Graphics g = this.CreateGraphics(); Bitmap bmp = new Bitmap(pictureBox1.Image); ...
阅读全文
百叶窗效果
摘要:Bitmap bmp = new Bitmap(pictureBox1.Image); ///等分 int divide = 11; int divideLine = divide + 1; //百叶窗宽度 ...
阅读全文
图片浮雕
摘要:Bitmap bmp = new Bitmap(pictureBox1.Image);//创建Bitmap对象 for (int i = 0; i < bmp.Width - 1; i++) { for (int j = 0;...
阅读全文
向区域中追加文本
摘要:Graphics g;//画板 GraphicsPath path;//路径 private void button1_Click(object sender, EventArgs e) { //从路径中构造区域 ...
阅读全文
伽马曲线调整图片
摘要:private void Form1_Load(object sender, EventArgs e) { img = pictureBox1.Image = Image.FromFile("8.jpg"); } Ima...
阅读全文
改变图片亮度
摘要:private void button1_Click(object sender, EventArgs e) { UpdatePicBoxEventHandle UpdatePicBox = new UpdatePicBoxEventHandle(...
阅读全文
改变图片的对比度
摘要:private void button1_Click(object sender, EventArgs e) { UpdatePicBoxEventHandle UpdatePicBox = new UpdatePicBoxEventHandle(...
阅读全文
设置/取消桌面背景
摘要:private void Set_Click(object sender, EventArgs e) { //设置壁纸 SystemParametersInfo(SystemParametersInfoAction.SPI_SETDESKW...
阅读全文
放大镜
摘要:using (Graphics g = pictureBox1.CreateGraphics()) {//画板 Rectangle sourceRec = new Rectangle(e.X - 10, e.Y - 10, 10, ...
阅读全文
图片缩放/旋转/平移/设置分辨率
摘要:#region 设置分辨率 using (Graphics g = pictureBox2.CreateGraphics()) { g.Clear(pictureBox2.BackColor);//清空 ...
阅读全文
贝塞尔样条
摘要:/*贝塞尔样条是由四个点指定的曲线:两个端点(p1 和 p2)和两个控制点(c1 和 c2)。曲线开始于 p1,结束于 p2。 * 该曲线不经过控制点,但是控制点的作用像磁铁一样,在某些方向上拉拽曲线并影响曲线弯曲的方式。 该曲线始于 p1 并向控制点...
阅读全文
线性梯度画刷
摘要:using (Graphics graphics = this.CreateGraphics()) {// graphics.Clear(Color.White); Pen pen = new Pen(Color.Red, 2); ...
阅读全文
画七彩五角星
摘要:using (Graphics graphics = this.CreateGraphics()) { graphics.Clear(Color.White); Point[] points = {//顺时针点坐标...
阅读全文
画花纹图案
摘要:using (Graphics g = this.CreateGraphics()) {//画板 g.FillRectangle(Brushes.White, this.ClientRectangle);//画板颜色 ...
阅读全文
画箭头
摘要:using (Pen mypen = new Pen(Color.Black, 6)) { mypen.StartCap = LineCap.DiamondAnchor;//设置起始箭头 mypen.EndCap = ...
阅读全文
图片填充线条
摘要:Bitmap bitmap = new Bitmap("1.jpg"); TextureBrush b = new TextureBrush(bitmap);//指定纹理图片 Pen p = new Pen(b, 30);//创建画笔 ...
阅读全文
打开/关闭光驱
摘要:/// /// The mciSendString function sends a command string to an MCI device. The device that the command is sent to is specified in the command...
阅读全文
检测声卡是否安装
摘要:/// /// The waveOutGetNumDevs function retrieves the number of waveform-audio output devices present in the system. /// /// Ret...
阅读全文
创建快捷方式
摘要:WshShell shell = new WshShell();//建立对象 //生成快捷方式文件,指定路径及文件名 IWshShortcut shortcut = (IWshShortcut)shell.CreateShortcut( Environme...
阅读全文
接收按键消息
摘要:public const int WM_KEYDOWN = 0x0100;//按键消息 public const int WM_SYSKEYDOWN = 0x0104;//快捷键或系统命令键的消息 protected override bool ProcessCmdKe...
阅读全文
注册系统热键
摘要:/// /// Defines a system-wide hot key. /// /// A handle to the window that will receive WM_HOTKEY messages generated by the hot...
阅读全文
获取剪贴板中的数据
摘要:/// /// Adds the specified window to the chain of clipboard viewers. Clipboard viewer windows receive a WM_DRAWCLIPBOARD message whenever the...
阅读全文
遍历系统环境变量的键和值
摘要://遍历环境变量的键和值 foreach(DictionaryEntry en in Environment.GetEnvironmentVariables()) { en.Key.ToString(); ...
阅读全文
获取鼠标位置的颜色值
摘要:Color c = new Color();//创建颜色对象 Bitmap bitmap = new Bitmap(this.BackgroundImage);//创建BITMAP对象 int x = Cursor.Position.X;//鼠标x坐标 ...
阅读全文
接触/限制鼠标活动区域
摘要:this.Cursor = new Cursor(Cursor.Current.Handle); Cursor.Position = new Point(Cursor.Position.X,Cursor.Position.Y);//鼠标位置 Cursor....
阅读全文
获取系统用户名
摘要:ManagementClass mc = new ManagementClass("Win32_ComputerSystem");//实例化 ManagementObjectCollection moc = mc.GetInstances();//获取管理对象集合 ...
阅读全文
获取进程并关闭
摘要:using System.Diagnostics;Process[] myprocess = Process.GetProcesses();//获取进程foreach (Process pro in myprocess) { if (pro.Mai...
阅读全文
获取/设置计算机名字
摘要:using Microsoft.VisualBasic.Devices;//Microsoft.VisualBasic.dll/// /// Sets a new NetBIOS name for the local computer. The name is stored in t...
阅读全文
设置系统时间
摘要:/// /// Sets the current local time and date. /// /// /// [DllImport("kernel32", CharSet = CharSet.Unicode, Se...
阅读全文
隐藏/显示任务栏
摘要:/// /// Retrieves a handle to the top-level window whose class name and window name match the specified strings. This function does not sear...
阅读全文
鼠标左右键互换
摘要:/// /// Reverses or restores the meaning of the left and right mouse buttons. /// /// If this parameter is TRUE, the left button generates right-button messages and the righ...
阅读全文
清空回收站
摘要:/// /// Empties the Recycle Bin on the specified drive. /// /// A handle to the parent window of any dialog boxes that might be...
阅读全文
锁定计算机
摘要://锁定计算机[DllImportAttribute("user32.dll")]public static extern void LockWorkStation();禁止关闭计算机private const int WM_QUERYENDSESSION = 0x0011;//windows消息 ...
阅读全文
cmd
摘要:Process p = new Process();//创建进程对象 string drivename = cboDrive.Text;//盘符 string shareName = txtShareName.Text;//共享名 ...
阅读全文
磁盘信息
摘要:using System.Management;using System.IO; //System.Management.dll //创建WMI查询 ManagementObjectSearcher searcher = new ManagementObje...
阅读全文
Regist
摘要:using (RegistryKey key = Registry.CurrentUser.CreateSubKey(@"Software\Microsoft\Windows\CurrentVersion\Policies\Explorer")) { key.SetValue...
阅读全文
c# 隐藏 控制台应用程序
摘要:using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Diagnostics;using System.Runtime.InteropServices;namesp...
阅读全文
Ping
摘要:const int SOCKET_ERROR = -1; const int ICMP_ECHO = 8; public string PingHost(string host) { IPHostEntry server...
阅读全文
SQL 笔记
摘要:返回字符串中从左/右边开始指定个数的字符select left('wjshan0808',6) select right('wjshan0808',4)select left([Column_expression],1)返回字符、二进制、文本或图像表达式的一部分select substring('w...
阅读全文
数据库连接字符串
摘要:new SqlConnection("server=LJM\\MSSQL2005;database=MySchool;uid=sa;pwd=123456")//连接Access数据库new OleDbConnection("provider=Microsoft.Jet.OLEDB.4.0;dat...
阅读全文
获取网卡地址信息
摘要:public string GetMacAddress() { try { string mac = ""; ManagementClass mc = new Man...
阅读全文
启动所选择的应用程序
摘要:Process ps = new Process(); ps.StartInfo.FileName = textBox1.Text; //启动所选择的应用程序 ps.Start();
阅读全文
获取网络IP地址
摘要:IPHostEntry iphost = Dns.GetHostEntry(txtDNS.Text);//解析并返回IPHostEntry对象 foreach (IPAddress ip in iphost.AddressList)//遍历IP地址 ...
阅读全文
检测网络状态
摘要:/// /// Retrieves the connected state of the local system /// /// Pointer to a variable that receives the connection de...
阅读全文
邮件发送接收
摘要:string server = this.txtserver.Text; MailMessage Mail = new MailMessage(this.txtFrom.Text, this.txtGet.Text); Ma...
阅读全文
网页内容下载
摘要:string strl="";//存储编码 WebRequest request = WebRequest.Create(txtHtmlUrl.Text.Trim());//请求资源 WebResponse respons...
阅读全文
[转] asp.net <%%>&<%#%>&<%=%>&<%@%>&<%$%>用法区别
摘要:转自 参考 1.<% %>用来绑定后台代码 如: < % for(int i=0;i<100;i++) { Reaponse.Write(i.ToString()); } %> 2.<%# %> 是在绑定控件DataBind()方法执行时被执行,用于数据绑定 如: < %# Container.Da
阅读全文
正则表达式
摘要:邮箱验证:@"\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"网址@"http(s)?://([\w-]+\.)+[\w-]+(//[\w- .//?%&=]*)?"15位或18位身份证号码@"\d{17}[\d|X]|\d{15}"手机号@"1(47|(3...
阅读全文
加密器
摘要:///随机数加密byte[] randomByte = new byte[16];//创建字节数组 //实例化加密随机数生成器 RNGCryptoServiceProvider rng = new RNGCryptoServiceProvider(); ...
阅读全文
程序集属性访问器
摘要:#region 程序集属性访问器 public string AssemblyTitle { get { object[] attributes = Assembly.GetExecu...
阅读全文
模拟窗体附顶停靠隐藏
摘要:using System.Runtime.InteropServices;/* Winform的 FormBorderStyle=None; */namespace Windows_API_实现屏幕右下角_消息框_{ public partial class QQHide : F...
阅读全文
WinForm利用 WinApi实现 淡入淡出 弹出 效果 仿QQ消息
摘要:消息框:using System.Runtime.InteropServices;namespace Windows_API_实现屏幕右下角_消息框_{ public partial class Msg : Form { public Msg() { ...
阅读全文
Web TreeView 加载级联数据
摘要:protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { dt = BLL.GetTable(); LoadLYRProperties(0, null); ...
阅读全文