LINQ to ListControl.txt
LINQ to ListControl.txt
Image-Access.rar
Image-Access.rarImage-Access.rarImage-Access.rar
C# 创建Access数据库表
C# 创建Access数据库表C# 创建Access数据库表
C# 图片管理C# 图片管理
C# 图片管理C# 图片管理C# 图片管理C# 图片管理
C# 浏览图片C# 浏览图片
C# 浏览图片C# 浏览图片C# 浏览图片
WebOLEDB.rarWebOLEDB.rarWebOLEDB.rar
WebOLEDB.rarWebOLEDB.rarWebOLEDB.rarWebOLEDB.rar
ImageSQL.rarImageSQL.rarImageSQL.rar
ImageSQL.rarImageSQL.rarImageSQL.rarImageSQL.rar
DIYShutDown.rar.rar
DIYShutDown.DIYShutDown.rarrarDIYShutDown.rar
WinFormImage.rarWinFormImage.rarWinFormImage.rar
WinFormImage.rarWinFormImage.rarWinFormImage.rar
WinFormImageWinFormImageWinFormImage
WinFormImageWinFormImageWinFormImageWinFormImage
ImageAccess.ImageAccess.ImageAccess.
ImageAccess.rarImageAccess.rarImageAccess.rar
C#WinFormImage.rar
C#WinFormImage.rarC#WinFormImage.rar
C# 图片管理C# 图片管理C# 图片管理
C# 图片管理C# 图片管理C# 图片管理C# 图片管理
C# 图片存储到剪贴板里
C# 图片存储到剪贴板里C# 图片存储到剪贴板里C# 图片存储到剪贴板里
FormMDI.csFormMDI.csFormMDI.cs
FormMDI.csFormMDI.csFormMDI.csFormMDI.cs
C# 绘制时钟C# 绘制时钟
C# 绘制时钟C# 绘制时钟C# 绘制时钟
C# 动画窗体AnimateWindow
C# 动画窗体AnimateWindow
C# 绘制时钟程序源代码
C# 绘制时钟程序C# 绘制时钟程序C# 绘制时钟程序
录音机录音机录音机.rar
录音机.rar录音机.rar录音机.rar
WinFormMDI-Image.rar
WinFormMDI-Image.rarWinFormMDI-Image.rar
C# 日程安排表,定时关机,截图工具,阴阳历互转
C# 日程安排表,定时关机,截图工具,阴阳历互转C# 日程安排表,定时关机,截图工具,阴阳历互转C# 日程安排表,定时关机,截图工具,阴阳历互转
C# 定时关机,开机,锁机
C# 定时关机,开机,锁机C# 定时关机,开机,锁机C# 定时关机,开机,锁机C# 定时关机,开机,锁机
c# 日程安排表c# 日程安排表
c# 日程安排表c# 日程安排表c# 日程安排表
C# 创建有密码的Excel 文件
C# 创建有密码的Excel 文件C# 创建有密码的Excel 文件
用arp 绑定IP和MAC地址
用arp 绑定IP和MAC地址用arp 绑定IP和MAC地址用arp 绑定IP和MAC地址用arp 绑定IP和MAC地址用arp 绑定IP和MAC地址
using System;using System;using System;
using System;
using System.IO;
using System.Text.RegularExpressions;
using System.Windows.Forms;
using Microsoft.Win32;
namespace MRU
{
public partial class FormMRU : Form
{
public FormMRU()
{
#region
InitializeComponent();
ListView listViewMRU = new ListView();
listViewMRU.Dock = DockStyle.Fill;
listViewMRU.HeaderStyle = ColumnHeaderStyle.None; // 隐藏列标题。
listViewMRU.View = View.Details; // 详细信息。
listViewMRU.CheckBoxes = true; // 显示复选框。
listViewMRU.Scrollable = false; // 隐藏滚动条。
listViewMRU.ShowGroups = true; // 分组显示项。
listViewMRU.BeginUpdate();
ListViewGroup pro = listViewMRU.Groups.Add("profile", "profile");
listViewMRU.Items.Add(Environment.GetFolderPath(Environment.SpecialFolder.Recent)).Group = pro;
listViewMRU.Items.Add(Environment.GetFolderPath(Environment.SpecialFolder.Cookies)).Group = pro;
listViewMRU.Items.Add(Path.GetTempPath()).Group = pro;
listViewMRU.Items.Add(Environment.GetFolderPath(Environment.SpecialFolder.History)).Group = pro;
listViewMRU.Items.Add(Environment.GetFolderPath(Environment.SpecialFolder.InternetCache)).Group = pro;
ListViewGroup reg = listViewMRU.Groups.Add("regedit", "regedit");
listViewMRU.Items.Add(@"HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\TypedURLs").Group = reg;
listViewMRU.Items.Add(@"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\RunMRU").Group = reg;
listViewMRU.Items.Add(@"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\ComDlg32").Group = reg;
listViewMRU.Items.Add(@"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Applets\Paint").Group = reg;
listViewMRU.Items.Add(@"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Applets\Wordpad").Group = reg;
ColumnHeader column = listViewMRU.Columns.Add("");
column.AutoResize(ColumnHeaderAutoResizeStyle.ColumnContent); // 自动调整列宽。
listViewMRU.EndUpdate();
listViewMRU.ItemChecked += new ItemCheckedEventHandler(listViewMRU_ItemChecked);
this.Controls.Add(listViewMRU);
this.ClientSize = new System.Drawing.Size(column.Width + 8, 260);
this.Text = Environment.UserName;
this.AutoSizeMode = AutoSizeMode.GrowAndShrink; // 禁用手动调整大小。
this.SizeGripStyle = SizeGripStyle.Hide; // 隐藏调整大小手柄。
this.StartPosition = FormStartPosition.CenterScreen; // 在桌面居中显示。
#endregion
}
#region ListView_ItemChecked
private void listViewMRU_ItemChecked(object sender, ItemCheckedEventArgs e)
{
if (!e.Item.Checked)
return;
DirectoryInfo dir = new DirectoryInfo(e.Item.Text);
switch (e.Item.Index)
{
case 0:
case 1:
foreach (FileInfo info in dir.GetFiles())
{
if (Regex.IsMatch(info.Extension, @".(dat|ini)", RegexOptions.IgnoreCase)) // 指定不区分大小写的匹配。
continue;
this.Text = info.Name;
info.Delete();
}
break;
case 2:
foreach (FileSystemInfo info in dir.GetFileSystemInfos())
{
try
{
if (info is FileInfo)
info.Delete();
else
(info as DirectoryInfo).Delete(true);
}
catch
{
continue;
}
finally
{
this.Text = info.Name;
}
}
break;
case 3:
System.Diagnostics.Process.Start(e.Item.Text);
break;
case 4:
foreach (FileInfo info in dir.GetFiles("*.*", SearchOption.AllDirectories))
{
if (Regex.IsMatch(info.Extension, @".(dat|ini)", RegexOptions.IgnoreCase)) // 指定不区分大小写的匹配。
continue;
try
{
info.Delete();
}
catch
{
continue;
}
finally
{
this.Text = info.Name;
}
}
break;
case 5:
using (RegistryKey subKey = Registry.CurrentUser.CreateSubKey(@"Software\Microsoft\Internet Explorer\TypedURLs"))
{
foreach (string mru in subKey.GetValueNames())
{
subKey.DeleteValue(mru);
}
}
break;
case 6:
using (RegistryKey subKey = Registry.CurrentUser.CreateSubKey(@"Software\Microsoft\Windows\CurrentVersion\Explorer\RunMRU"))
{
foreach (string mru in subKey.GetValueNames())
{
subKey.DeleteValue(mru);
}
}
break;
case 7:
using (RegistryKey subKey = Registry.CurrentUser.CreateSubKey(@"Software\Microsoft\Windows\CurrentVersion\Explorer\ComDlg32"))
{
foreach (string mru in subKey.GetSubKeyNames())
{
subKey.DeleteSubKeyTree(mru);
}
}
break;
case 8:
using (RegistryKey subKey = Registry.CurrentUser.CreateSubKey(@"Software\Microsoft\Windows\CurrentVersion\Applets\Paint\Recent File List"))
{
foreach (string mru in subKey.GetValueNames())
{
subKey.DeleteValue(mru);
}
}
break;
case 9:
using (RegistryKey subKey = Registry.CurrentUser.CreateSubKey(@"Software\Microsoft\Windows\CurrentVersion\Applets\Wordpad\Recent File List"))
{
foreach (string mru in subKey.GetValueNames())
{
subKey.DeleteValue(mru);
}
}
break;
}
this.Text = Environment.UserName;
}
#endregion
}
}using System;
using System.IO;
using System.Text.RegularExpressions;
using System.Windows.Forms;
using Microsoft.Win32;
namespace MRU
{
public partial class FormMRU : Form
{
public FormMRU()
{
#region
InitializeComponent();
ListView listViewMRU = new ListView();
listViewMRU.Dock = DockStyle.Fill;
listViewMRU.HeaderStyle = ColumnHeaderStyle.None; // 隐藏列标题。
listViewMRU.View = View.Details; // 详细信息。
listViewMRU.CheckBoxes = true; // 显示复选框。
listViewMRU.Scrollable = false; // 隐藏滚动条。
listViewMRU.ShowGroups = true; // 分组显示项。
listViewMRU.BeginUpdate();
ListViewGroup pro = listViewMRU.Groups.Add("profile", "profile");
listViewMRU.Items.Add(Environment.GetFolderPath(Environment.SpecialFolder.Recent)).Group = pro;
listViewMRU.Items.Add(Environment.GetFolderPath(Environment.SpecialFolder.Cookies)).Group = pro;
listViewMRU.Items.Add(Path.GetTempPath()).Group = pro;
listViewMRU.Items.Add(Environment.GetFolderPath(Environment.SpecialFolder.History)).Group = pro;
listViewMRU.Items.Add(Environment.GetFolderPath(Environment.SpecialFolder.InternetCache)).Group = pro;
ListViewGroup reg = listViewMRU.Groups.Add("regedit", "regedit");
listViewMRU.Items.Add(@"HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\TypedURLs").Group = reg;
listViewMRU.Items.Add(@"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\RunMRU").Group = reg;
listViewMRU.Items.Add(@"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\ComDlg32").Group = reg;
listViewMRU.Items.Add(@"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Applets\Paint").Group = reg;
listViewMRU.Items.Add(@"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Applets\Wordpad").Group = reg;
ColumnHeader column = listViewMRU.Columns.Add("");
column.AutoResize(ColumnHeaderAutoResizeStyle.ColumnContent); // 自动调整列宽。
listViewMRU.EndUpdate();
listViewMRU.ItemChecked += new ItemCheckedEventHandler(listViewMRU_ItemChecked);
this.Controls.Add(listViewMRU);
this.ClientSize = new System.Drawing.Size(column.Width + 8, 260);
this.Text = Environment.UserName;
this.AutoSizeMode = AutoSizeMode.GrowAndShrink; // 禁用手动调整大小。
this.SizeGripStyle = SizeGripStyle.Hide; // 隐藏调整大小手柄。
this.StartPosition = FormStartPosition.CenterScreen; // 在桌面居中显示。
#endregion
}
#region ListView_ItemChecked
private void listViewMRU_ItemChecked(object sender, ItemCheckedEventArgs e)
{
if (!e.Item.Checked)
return;
DirectoryInfo dir = new DirectoryInfo(e.Item.Text);
switch (e.Item.Index)
{
case 0:
case 1:
foreach (FileInfo info in dir.GetFiles())
{
if (Regex.IsMatch(info.Extension, @".(dat|ini)", RegexOptions.IgnoreCase)) // 指定不区分大小写的匹配。
continue;
this.Text = info.Name;
info.Delete();
}
break;
case 2:
foreach (FileSystemInfo info in dir.GetFileSystemInfos())
{
try
{
if (info is FileInfo)
info.Delete();
else
(info as DirectoryInfo).Delete(true);
}
catch
{
continue;
}
finally
{
this.Text = info.Name;
}
}
break;
case 3:
System.Diagnostics.Process.Start(e.Item.Text);
break;
case 4:
foreach (FileInfo info in dir.GetFiles("*.*", SearchOption.AllDirectories))
{
if (Regex.IsMatch(info.Extension, @".(dat|ini)", RegexOptions.IgnoreCase)) // 指定不区分大小写的匹配。
continue;
try
{
info.Delete();
}
catch
{
continue;
}
finally
{
this.Text = info.Name;
}
}
break;
case 5:
using (RegistryKey subKey = Registry.CurrentUser.CreateSubKey(@"Software\Microsoft\Internet Explorer\TypedURLs"))
{
foreach (string mru in subKey.GetValueNames())
{
subKey.DeleteValue(mru);
}
}
break;
case 6:
using (RegistryKey subKey = Registry.CurrentUser.CreateSubKey(@"Software\Microsoft\Windows\CurrentVersion\Explorer\RunMRU"))
{
foreach (string mru in subKey.GetValueNames())
{
subKey.DeleteValue(mru);
}
}
break;
case 7:
using (RegistryKey subKey = Registry.CurrentUser.CreateSubKey(@"Software\Microsoft\Windows\CurrentVersion\Explorer\ComDlg32"))
{
foreach (string mru in subKey.GetSubKeyNames())
{
subKey.DeleteSubKeyTree(mru);
}
}
break;
case 8:
using (RegistryKey subKey = Registry.CurrentUser.CreateSubKey(@"Software\Microsoft\Windows\CurrentVersion\Applets\Paint\Recent File List"))
{
foreach (string mru in subKey.GetValueNames())
{
subKey.DeleteValue(mru);
}
}
break;
case 9:
using (RegistryKey subKey = Registry.CurrentUser.CreateSubKey(@"Software\Microsoft\Windows\CurrentVersion\Applets\Wordpad\Recent File List"))
{
foreach (string mru in subKey.GetValueNames())
{
subKey.DeleteValue(mru);
}
}
break;
}
this.Text = Environment.UserName;
}
#endregion
}
}
kingzhexian ko-kr
kingzhexian ko-krkingzhexian ko-kr
OpenhomePageOpenhomePageOpenhomePage
OpenhomePageOpenhomePageOpenhomePage
excel 技巧及快捷键
excel 技巧及快捷键 excel 技巧及快捷键 excel 技巧及快捷键 excel 技巧及快捷键
namespace MSExcel
namespace MSExcel
{
partial class FormExcel
{
private System.ComponentModel.IContainer components = null;
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows 窗体设计器生成的代码
private void InitializeComponent()
{
this.buttonOpen = new System.Windows.Forms.Button();
this.buttonSave = new System.Windows.Forms.Button();
this.groupOpen = new System.Windows.Forms.GroupBox();
this.maskedTextVOpen = new System.Windows.Forms.MaskedTextBox();
this.label1 = new System.Windows.Forms.Label();
this.maskedTextOpen = new System.Windows.Forms.MaskedTextBox();
this.labelOpen = new System.Windows.Forms.Label();
this.groupUpdate = new System.Windows.Forms.GroupBox();
this.maskedTextVUpdate = new System.Windows.Forms.MaskedTextBox();
this.label2 = new System.Windows.Forms.Label();
this.maskedTextUpdate = new System.Windows.Forms.MaskedTextBox();
this.labelUpdate = new System.Windows.Forms.Label();
this.groupOpen.SuspendLayout();
this.groupUpdate.SuspendLayout();
this.SuspendLayout();
//
// buttonOpen
//
this.buttonOpen.Location = new System.Drawing.Point(44, 200);
this.buttonOpen.Name = "buttonOpen";
this.buttonOpen.Size = new System.Drawing.Size(75, 23);
this.buttonOpen.TabIndex = 10;
this.buttonOpen.Text = "打开(&O)";
this.buttonOpen.UseVisualStyleBackColor = true;
this.buttonOpen.Click += new System.EventHandler(this.buttonOpen_Click);
//
// buttonSave
//
this.buttonSave.Location = new System.Drawing.Point(173, 200);
this.buttonSave.Name = "buttonSave";
this.buttonSave.Size = new System.Drawing.Size(75, 23);
this.buttonSave.TabIndex = 11;
this.buttonSave.Text = "保存(&S)";
this.buttonSave.UseVisualStyleBackColor = true;
this.buttonSave.Click += new System.EventHandler(this.buttonSave_Click);
//
// groupOpen
//
this.groupOpen.Controls.Add(this.maskedTextVOpen);
this.groupOpen.Controls.Add(this.label1);
this.groupOpen.Controls.Add(this.maskedTextOpen);
this.groupOpen.Controls.Add(this.labelOpen);
this.groupOpen.Location = new System.Drawing.Point(8, 8);
this.groupOpen.Name = "groupOpen";
this.groupOpen.Size = new System.Drawing.Size(277, 80);
this.groupOpen.TabIndex = 0;
this.groupOpen.TabStop = false;
this.groupOpen.Text = "打开权限密码";
//
// maskedTextVOpen
//
this.maskedTextVOpen.Location = new System.Drawing.Point(80, 50);
this.maskedTextVOpen.Mask = "CCCCCCCCCCCCCCCCCCCCCCCCCCCCCC";
this.maskedTextVOpen.Name = "maskedTextVOpen";
this.maskedTextVOpen.Size = new System.Drawing.Size(186, 21);
this.maskedTextVOpen.TabIndex = 4;
this.maskedTextVOpen.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(10, 55);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(65, 12);
this.label1.TabIndex = 3;
this.label1.Text = "确认密码:";
//
// maskedTextOpen
//
this.maskedTextOpen.Location = new System.Drawing.Point(80, 20);
this.maskedTextOpen.Mask = "CCCCCCCCCCCCCCCCCCCCCCCCCCCCCC";
this.maskedTextOpen.Name = "maskedTextOpen";
this.maskedTextOpen.Size = new System.Drawing.Size(186, 21);
this.maskedTextOpen.TabIndex = 2;
this.maskedTextOpen.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
//
// labelOpen
//
this.labelOpen.AutoSize = true;
this.labelOpen.Location = new System.Drawing.Point(10, 24);
this.labelOpen.Name = "labelOpen";
this.labelOpen.Size = new System.Drawing.Size(65, 12);
this.labelOpen.TabIndex = 1;
this.labelOpen.Text = "创建密码:";
//
// groupUpdate
//
this.groupUpdate.Controls.Add(this.maskedTextVUpdate);
this.groupUpdate.Controls.Add(this.label2);
this.groupUpdate.Controls.Add(this.maskedTextUpdate);
this.groupUpdate.Controls.Add(this.labelUpdate);
this.groupUpdate.Location = new System.Drawing.Point(8, 100);
this.groupUpdate.Name = "groupUpdate";
this.groupUpdate.Size = new System.Drawing.Size(277, 80);
this.groupUpdate.TabIndex = 5;
this.groupUpdate.TabStop = false;
this.groupUpdate.Text = "修改权限密码";
//
// maskedTextVUpdate
//
this.maskedTextVUpdate.Location = new System.Drawing.Point(80, 50);
this.maskedTextVUpdate.Mask = "CCCCCCCCCCCCCCCCCCCCCCCCCCCCCC";
this.maskedTextVUpdate.Name = "maskedTextVUpdate";
this.maskedTextVUpdate.Size = new System.Drawing.Size(186, 21);
this.maskedTextVUpdate.TabIndex = 9;
this.maskedTextVUpdate.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(10, 55);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(65, 12);
this.label2.TabIndex = 8;
this.label2.Text = "确认密码:";
//
// maskedTextUpdate
//
this.maskedTextUpdate.Location = new System.Drawing.Point(80, 20);
this.maskedTextUpdate.Mask = "CCCCCCCCCCCCCCCCCCCCCCCCCCCCCC";
this.maskedTextUpdate.Name = "maskedTextUpdate";
this.maskedTextUpdate.Size = new System.Drawing.Size(186, 21);
this.maskedTextUpdate.TabIndex = 7;
this.maskedTextUpdate.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
//
// labelUpdate
//
this.labelUpdate.AutoSize = true;
this.labelUpdate.Location = new System.Drawing.Point(10, 24);
this.labelUpdate.Name = "labelUpdate";
this.labelUpdate.Size = new System.Drawing.Size(65, 12);
this.labelUpdate.TabIndex = 6;
this.labelUpdate.Text = "创建密码:";
//
// FormExcel
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(293, 246);
this.Controls.Add(this.groupUpdate);
this.Controls.Add(this.groupOpen);
this.Controls.Add(this.buttonSave);
this.Controls.Add(this.buttonOpen);
this.Name = "FormExcel";
this.groupOpen.ResumeLayout(false);
this.groupOpen.PerformLayout();
this.groupUpdate.ResumeLayout(false);
this.groupUpdate.PerformLayout();
this.ResumeLayout(false);
}
#endregion
#region
private System.Windows.Forms.Button buttonOpen;
private System.Windows.Forms.Button buttonSave;
private System.Windows.Forms.GroupBox groupOpen;
private System.Windows.Forms.GroupBox groupUpdate;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label labelOpen;
private System.Windows.Forms.Label labelUpdate;
private System.Windows.Forms.MaskedTextBox maskedTextOpen;
private System.Windows.Forms.MaskedTextBox maskedTextUpdate;
private System.Windows.Forms.MaskedTextBox maskedTextVOpen;
private System.Windows.Forms.MaskedTextBox maskedTextVUpdate;
#endregion
}
}
锁屏.reg锁屏.reg
锁屏.reg锁屏.reg锁屏.reg锁屏.reg锁屏.reg锁屏.reg
播放器DIY播放器DIY播放器DIY
播放器DIY播放器DIY播放器DIY播放器DIY
Excel技巧Excel技巧
Excel技巧Excel技巧Excel技巧Excel技巧
清空剪贴板清空剪贴板
清空剪贴板清空剪贴板清空剪贴板清空剪贴板
作者:金哲显编的软件
using System;
using System.Drawing;
using System.Windows.Forms;
namespace ClipImage
{
public partial class FormImage : Form
{
#region
private Point position;
private Rectangle clip;
#endregion
public FormImage()
{
#region
InitializeComponent();
this.TopMost = true; // 前端显示。
this.ShowInTaskbar = false; // 在 Windows 任务栏中隐藏窗体。
this.DoubleBuffered = true; // 双缓冲绘制图形。
this.FormBorderStyle = FormBorderStyle.None; // 窗体无边框。
this.Bounds = Screen.GetBounds(this); // 获取显示器的桌面区域。
this.TransparencyKey = this.BackColor; // 窗体背景透明化。
NotifyIcon notify = new NotifyIcon();
notify.Visible = true; // 图标在任务栏的通知区域中可见。
notify.Icon = Icon.ExtractAssociatedIcon(Application.ExecutablePath); // 启动程序图标。
notify.Text = AppDomain.CurrentDomain.FriendlyName; // 启动程序名称。
notify.MouseClick += new MouseEventHandler(notify_MouseClick);
#endregion
}
#region OnMouseDown
protected override void OnMouseDown(MouseEventArgs e)
{
base.OnMouseDown(e);
switch (e.Button)
{
case MouseButtons.Left:
position = e.Location; // 设置起始位置。
break;
case MouseButtons.Right:
if (clip.Width > 1 && clip.Height > 1)
{
clip.Offset(1, 1); // 平移。
using (Bitmap bmp = new Bitmap(--clip.Width, --clip.Height))
using (Graphics g = Graphics.FromImage(bmp))
{
g.CopyFromScreen(clip.Location, Point.Empty, clip.Size); // 截图。
bmp.Save("Image.png", bmp.RawFormat); // 保存图片。
Clipboard.SetImage(bmp); // 图片存储到剪贴板中。
}
System.Diagnostics.Process.Start("mspaint.exe", "Image.png"); // 用画图打开图片。
}
clip = Rectangle.Empty;
BackgroundImage.Dispose();
BackgroundImage = null;
break;
}
}
#endregion
#region OnMouseMove
protected override void OnMouseMove(MouseEventArgs e)
{
base.OnMouseMove(e);
if (e.Button == MouseButtons.Left)
{
clip.X = Math.Min(position.X, e.X);
clip.Y = Math.Min(position.Y, e.Y);
clip.Width = Math.Abs(position.X - e.X);
clip.Height = Math.Abs(position.Y - e.Y);
this.Refresh(); // 立即重绘图形。
}
}
#endregion
#region OnPaint
protected override void OnPaint(PaintEventArgs e)
{
base.OnPaint(e);
e.Graphics.DrawRectangle(Pens.Red, clip);
e.Dispose();
}
#endregion
#region NotifyIcon
private void notify_MouseClick(object sender, MouseEventArgs e)
{
switch (e.Button)
{
case MouseButtons.Left:
this.BackgroundImage = new Bitmap(this.Width, this.Height);
using (Graphics g = Graphics.FromImage(this.BackgroundImage))
{
g.CopyFromScreen(Point.Empty, Point.Empty, this.Size);
}
this.Activate(); // 激活窗体并给予它焦点。
break;
case MouseButtons.Right:
(sender as NotifyIcon).Dispose();
Application.Exit();
break;
}
}
#endregion
}
}
EXCEL 快捷键和公式
EXCEL 快捷键和公式EXCEL 快捷键和公式EXCEL 快捷键和公式
用注册表修复IE主页
用注册表修复IE主页用注册表修复IE主页
C# 修复IE主页C# 修复IE主页
C# 修复IE主页C# 修复IE主页C# 修复IE主页
OpenhomePage
OpenhomePageOpenhomePageOpenhomePage
定时待机,关机,锁机·
定时待机,关机,锁机·定时待机,关机,锁机·