摘要: 1、Assembly.GetExecutingAssembly().Location得到exe的全路径,Path.GetDirectoryName得到目录路径,不要用Directory.GetCurrentDirectory(),这个可能会变(使用OpenFileDialog或者SetCurrentDirectory())。2、AppDomain.CurrentDomain.BaseDirectory; // 获取当前程序的目录3、System.Environment.CurrentDirectory// 获取当前程序的目录4、Application.StartupPath// 获取当前程序的 阅读全文
posted @ 2013-09-21 11:43 LS庆 阅读(379) 评论(0) 推荐(0) 编辑
摘要: 获取桌面的宽度:Screen.PrimaryScreen.WorkingArea.Width;获取桌面的高度:Screen.PrimaryScreen.WorkingArea.Height;获取桌面的高度:Screen.AllScreens[0].WorkingArea.Height;Screen.PrimaryScreen.WorkingArea属性用于获取显示器的工作区。工作区是显示器的桌面区域,不包括任务栏、停靠窗口和停靠工具栏。得到屏幕的范围:Screen.GetWorkingArea(new Point(0,0));Screen screen = Screen.PrimaryScre 阅读全文
posted @ 2013-09-21 11:39 LS庆 阅读(545) 评论(0) 推荐(0) 编辑