摘要: View Code 1 C# 获取路径 2 string str1 =Process.GetCurrentProcess().MainModule.FileName;//获得当前执行的exe的文件名。 3 string str2=Environment.CurrentDirectory;//获取和设置当前目录的完全限定路径。 4 string str3=Directory.GetCurrentDirectory();//获取应用程序的当前工作目录。 5 string str4=AppDomain.CurrentDomain.BaseDirectory;//获取基目录,它由程序集冲突解决程序用. 阅读全文
posted @ 2012-09-29 14:06 J_une 阅读(113) 评论(0) 推荐(0)
摘要: 点击窗体的FormClosing事件,插入 如下代码:private void Form1_FormClosing(object sender, FormClosingEventArgs e) { if (MessageBox.Show("您确认退出吗?", "www.cnblogs.com/jihua", MessageBoxButtons.YesNoCancel) == System.Windows.Forms.DialogResult.Yes) { Dispose(); ... 阅读全文
posted @ 2012-09-29 13:58 J_une 阅读(247) 评论(0) 推荐(0)
摘要: System.Diagnostics.Process.Start("iexplore.exe", "http://www.cnblogs.com/jihua/"); 阅读全文
posted @ 2012-09-29 13:37 J_une 阅读(196) 评论(0) 推荐(0)
摘要: using System.Net;namespace Jihua.Cnblogs.Com{ class NetHelper { /// <summary> /// 获取所有本机IP地址,包括局域网IP和本机外网IP(如果有) /// </summary> /// <returns>192.168.1.10|220.181.112.143</returns> public static string GetAllIP() { IPAddress[] IP = Dns.GetHos... 阅读全文
posted @ 2012-09-29 13:28 J_une 阅读(273) 评论(0) 推荐(0)