摘要:
/// <summary> /// 过滤特殊字符 /// </summary> /// <param name="str"></param> /// <returns></returns> public static string FilterSpecial(this string str) { if (str == string.Empty) //如果字符串为空,直接返回。 { return str; } else { str = str.Replace("'", stri 阅读全文
摘要:
/// <summary> /// 检查进程是否存在 /// </summary> /// <param name="Name"></param> /// <returns></returns> public static bool IsProcessExitst(string Name) { try { Process[] psList = Process.GetProcessesByName(Name); if (psList.Length > 0) { return true; } else 阅读全文
摘要:
/// <summary> /// 检查客户机上能否使用WebBrowser控件 /// </summary> /// <returns></returns> public static bool IsWebBrowserCanRun() { try { WebBrowser wb = new WebBrowser(); wb.Url = new Uri("http://www.baidu.com"); return true; } catch (Exception) { return false; } } 阅读全文
摘要:
public partial class ImageLoader : Form { private Point startPoint, endPoint; bool mark = false; Graphics bitG; Bitmap bits; public ImageLoader() { InitializeComponent(); picBox1.Dock = DockStyle.Fill; bits = new Bitmap(picBox1.Width, picBox1.Height); bitG = Graphics.FromImage(bits); bitG.Clear(Col. 阅读全文
摘要:
#region进入窗体时加载 publicFormAlarmInfoQuery() { InitializeComponent(); pictureBox1.ImageLocation="f:\\1.jpg"; this.MouseWheel+=newSystem.Windows.Forms.MouseEventHandler(this.panel1_MouseWheel); //判断是否已安装带滚轮的鼠标 //SystemInformation.MouseWheelPresent.ToString(); //获取鼠标滚轮在滚动时所获得的行数 //SystemInforma 阅读全文
摘要:
private void listView1_ItemDrag(object sender, ItemDragEventArgs e){listView1.DoDragDrop(listView1.SelectedItems, DragDropEffects.Move);}private void listView1_DragDrop(object sender, DragEventArgs e){//判断是否选择拖放的项,if (listView1.SelectedItems.Count == 0){return;}//定义项的坐标点Point cp = listView1.PointToC 阅读全文