fjfjfjfjfjfj

2013年9月23日

【.Net】2、8、16进制转换

摘要: Private Function Asc2String(ByVal str As String) As String Dim StrDesc As System.String = String.Empty If str = String.Empty OrElse str.Length Mod 2 0 Then MessageBox.Show("Input string error.", "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Exclamation) Asc2S... 阅读全文

posted @ 2013-09-23 20:37 撬棍 阅读(314) 评论(0) 推荐(0) 编辑

2013年9月19日

【.Net】执行CMD命令

摘要: Process proc = new Process(); proc.StartInfo.FileName = "cmd.exe"; proc.StartInfo.UseShellExecute = false; proc.StartInfo.RedirectStandardError = true; proc.StartInfo.RedirectStandardInput = true; proc.StartIn... 阅读全文

posted @ 2013-09-19 12:50 撬棍 阅读(182) 评论(0) 推荐(0) 编辑

【.Net】获取随机数函数

摘要: /// /// Get Random number /// /// /// /// private static int GetRandom(int minValue, int maxValue) { Random rand = new Random(); return rand.Next(minValue, maxValue); } 阅读全文

posted @ 2013-09-19 12:46 撬棍 阅读(293) 评论(0) 推荐(0) 编辑

【.Net】注册程序开机启动

摘要: public static void SetRegistryIsStart(bool IsStart) { if (IsStart) { try { string strAssName = Application.StartupPath + @"\" + Application.ProductName + @".exe"; string ShortFileName = Applicati... 阅读全文

posted @ 2013-09-19 12:39 撬棍 阅读(310) 评论(0) 推荐(0) 编辑

【.Net】把窗体“钉”到桌面上

摘要: #region "WinAPI" [DllImport("user32.dll")] private static extern IntPtr FindWindow(string lpClassName, string lpWindowName); [Dll... 阅读全文

posted @ 2013-09-19 12:37 撬棍 阅读(441) 评论(0) 推荐(0) 编辑

2013年9月18日

【.Net】多语言查看MSDN

摘要: 首先我觉的微软的帮助作的是非常非常的好,MSDN结构清晰,内容详细,几乎能找到任何需要的东西。先找到一种语言的页面,之后通过修改URL里的语言地区直接找到想要的语种显示。例如:中文:http://msdn.microsoft.com/zh-cn/英文:http://msdn.microsoft.co... 阅读全文

posted @ 2013-09-18 10:09 撬棍 阅读(133) 评论(0) 推荐(0) 编辑

2013年9月17日

【.Net】 显示星期字符串

摘要: labelTime.Text = string.Format("{0} {1}", DateTime.Now.ToString("yyyy年MM月dd日 HH:mm:ss"), System.Globalization.CultureInfo.CurrentCulture.DateTimeFormat.GetDayName(DateTime.Now.DayOfWeek)); 阅读全文

posted @ 2013-09-17 20:35 撬棍 阅读(172) 评论(0) 推荐(0) 编辑

【.Net】 判断时间字符串正确性

摘要: bool CheckDatetime(string strDateTime) { DateTime dtTemp; return DateTime.TryParse(strDateTime,out dtTemp); } 阅读全文

posted @ 2013-09-17 20:34 撬棍 阅读(172) 评论(0) 推荐(0) 编辑

【.Net】 实现窗口拖动

摘要: 实现点击Form可以拖动窗口。 #region 实现窗口拖动 [DllImport("user32.dll")] public static extern bool ReleaseCapture(); [DllImport("user32.dll")] public static extern bool SendMessage(IntPtr hwnd, int wMsg, int wParam, int lParam); private void frm_MouseDown(object sender, Mou... 阅读全文

posted @ 2013-09-17 20:29 撬棍 阅读(498) 评论(0) 推荐(0) 编辑

【.Net】 Winform 单例运行实例

摘要: VB: 简单了,只要在Project的属性里设置"(Make Single Instance Application)生成单个应用实例程序"即可。 VB这样设置之后,再次启动应用程序,正在运行的应用程序被激活。不会弹出消息。C#: 通过代码实现,修改Program.cs文件:static class Program { private static Mutex m_Mutex; [STAThread] static void Main() { Application.EnableVisualStyles(); ... 阅读全文

posted @ 2013-09-17 20:22 撬棍 阅读(628) 评论(0) 推荐(0) 编辑

导航