摘要:string str1 =Process.GetCurrentProcess().MainModule.FileName; //可获得当前执行的exe的文件名。 string str2=Environment.CurrentDirectory; //获取和设置当前目录(即该进程从中启动的目录)的完全限定路径。 //备注 按照定义,如果该进程在本地或网络驱动器的根目录中启动, //则此属性的值为驱动...
阅读全文
08 2005 档案
摘要:一、创建和释放TRegistry对象 1.创建TRegistry对象。为了操作注册表,要创建一个TRegistry对象:ARegistry := TRegistry.Create; 2.释放TRegistry对象。对注册表操作结束后,应释放TRegistry对象所占内存:ARegistry.Destroy。二、指定要操作的键 操作注册表时,首先应指定操作的主键:先给属性RootKey赋值以指...
阅读全文
摘要:usingSystem;usingSystem.Runtime.InteropServices;namespaceConsoleApplication{publicsealedclassEntryPoint{privateEntryPoint(){}[DllImport("Gdi32.dll",CharSet=CharSet.Auto,ExactSpelling=true)]publicstati...
阅读全文
摘要:下面的代码实现修改显示器分辨率和刷新频率的功能:usingSystem;usingSystem.Drawing;usingSystem.Collections;usingSystem.ComponentModel;usingSystem.Windows.Forms;usingSystem.Data;usingSystem.Runtime.InteropServices;namespaceScree...
阅读全文
摘要:全屏分辩率:Screen.PrimaryScreen.Bounds.Size工作区域分辩率:Screen.PrimaryScreen.WorkingArea.Size
阅读全文

浙公网安备 33010602011771号