上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 13 下一页
  2013年7月22日
摘要: 1、如果不想让程序在任务栏中显示,请把窗体的属性ShowInTaskbar设置为false;2、如果想让程序启动时就最小化,请设置窗体的属性WindowState设置为Minimized。(Minimized 最小化,Normal正常启动,Maximized最大化)3、拉一个NotifyIcon控件notifyIcon,为控件notifyIcon的属性Icon添加一个icon图标。4、可以为NotifyIcon加一个ContextMenuStrip右键菜单menu_Notify。5、本例子禁用了窗体最大化按钮。(设置窗体的属性MaximizeBox的属性为false)6、主要代码:#regio 阅读全文
posted @ 2013-07-22 15:27 Haydy 阅读(2351) 评论(0) 推荐(0)
摘要: 方法一: 已经证实能用的.usingSystem;usingSystem.Collections.Generic;usingSystem.ComponentModel;usingSystem.Data;usingSystem.Drawing;usingSystem.Text;usingSystem.Windows.Forms;usingSystem.Net;usingSystem.Net.NetworkInformation;namespacePingIpAddress{publicpartialclassForm1:Form{publicForm1(){InitializeComponent 阅读全文
posted @ 2013-07-22 12:46 Haydy 阅读(2237) 评论(0) 推荐(0)
  2013年7月10日
摘要: /// /// 将 字符串 转成 二进制 “10011100000000011100011111111101” /// /// /// public static string bianma(string s) { byte[] data = Encoding.Unicode.GetBytes(s); StringBuilder result = new StringBuilder(data.Length * 8); foreach (byte b in data) { result.Append(Convert.ToString(b, 2).PadLeft(8, '0'... 阅读全文
posted @ 2013-07-10 08:49 Haydy 阅读(3296) 评论(0) 推荐(0)
  2013年6月28日
摘要: using System.IOpublic void SaveFile() { //实例化一个保存文件对话框 SaveFileDialog sf = new SaveFileDialog(); //设置文件保存类型 sf.Filter = "txt文件|*.txt|xml"; //如果用户没有输入扩展名,自动追加后缀 sf.AddExtension = true; //设置标题 sf.Title = "写文件"; //如果用户点击了保存按钮 if (sf.ShowDialog() == DialogResult.OK) { //实例化一个文件流---&g 阅读全文
posted @ 2013-06-28 11:46 Haydy 阅读(553) 评论(0) 推荐(0)
摘要: 1、如果得到一个目录下的所有文件夹的地址?一个 A文件夹 下有很多文件夹如:b 、c、d 等文件夹假设A的绝对路径是:c:\aSystem.IO.DirectoryInfo aDir = new System.IO.DirectoryInfo("c:\\A");System.IO.DirectoryInfo[] dirs = aDir.GetDirectories(); 得到的dirs数组就是A文件夹所有的子文件夹,要得到名字就:dirs[0].FullNamedirs[1].FullNamedirs[2].FullName2、使用Directory.类可以实现对整个文件夹 阅读全文
posted @ 2013-06-28 10:02 Haydy 阅读(420) 评论(0) 推荐(0)
  2013年6月18日
摘要: publicclass Validator{ 验证邮箱#region 验证邮箱 /**////<summary> /// 验证邮箱 ///</summary> ///<param name="source"></param> ///<returns></returns> publicstaticbool IsEmail(string source) { return Regex.IsMatch(source, @"^[A-Za-z0-9](([_\.\-]?[a-zA-Z0-9]+)*)@&q 阅读全文
posted @ 2013-06-18 14:12 Haydy 阅读(313) 评论(0) 推荐(0)
  2013年6月4日
摘要: IsolatedStorageSettings以本地的方式存储在用户计算机中。是Silverlight的独立存储空间。System.IO.IsolatedStorage; 引用命名空间IsolatedStorageSettings userSettings = IsolatedStorageSettings.ApplicationSettings; //创建对象userSettings.Add("Name", tbName.Text); //添加名为Name的文本值string name=userSettings["Name"];注意:如果项目调试无法实 阅读全文
posted @ 2013-06-04 10:30 Haydy 阅读(151) 评论(0) 推荐(0)
  2013年5月24日
摘要: ESC键 VK_ESCAPE (27)回车键: VK_RETURN (13)TAB键: VK_TAB (9)Caps Lock键: VK_CAPITAL (20)Shift键: VK_SHIFT ($10)Ctrl键: VK_CONTROL (17)Alt键: VK_MENU (18)空格键: VK_SPACE ($20/32)退格键: VK_BACK (8)左徽标键: VK_LWIN (91)右徽标键: VK_LWIN (92)鼠标右键快捷键:VK_APPS (93)Insert键: VK_INSERT (45)Home键: VK_HOME (36)Page Up: VK_PRIOR (33 阅读全文
posted @ 2013-05-24 10:24 Haydy 阅读(2844) 评论(0) 推荐(0)
  2013年3月22日
摘要: 在项目中可能根据不同的用户,不同的区域加载不同的界面风格,琢磨了一下终于搞定了。代码如下:public static void OnloadTemplate(string tempName) { RazorViewEngine engine = ViewEngines.Engines.Where(e => e is RazorViewEngine).Single() as RazorViewEngine; engine.ViewLocationFormats = engine.PartialViewLocationFormats = engine.MasterLocationFormat 阅读全文
posted @ 2013-03-22 14:41 Haydy 阅读(378) 评论(0) 推荐(0)
摘要: 注意:所有提及类均在:System.Resources命名空间内。来看这三个类的常用成员:interface IResourceWriter: IDisposablevoid AddResource(string name, object/string/byte[]);//添加资源数据void Generate();//更新缓冲区(Flush)void Close();//调用Disposeinterface IResourceReader: IDisposable, IEnumerableIDictionaryEnumerator GetEnumerator();//获取字典迭代器(用来枚举 阅读全文
posted @ 2013-03-22 14:05 Haydy 阅读(2293) 评论(0) 推荐(0)
上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 13 下一页