首页
Python
Java
IOS
Andorid
NodeJS
JavaScript
HTML5
【
delphi 获取可执行文件的当前路径
】的更多相关文章
delphi 获取可执行文件的当前路径
在Delphi SysUtils 单元中有 ExtractFileDir 与 ExtractFilePath两个类似的函数, 两个函数有以下的区别: ExtractFilePath 传回值的最後一个字元是反斜杠“/”. ShowMessage(ExtractFileDir(Application.Exename)); // 返回值为 c:/temp ShowMessage(ExtractFilePath(Application.Exename)); // 返回值为 c:/temp/ 相同点: 如…
Boost编程之获取可执行文件的当前路径
#include <boost/filesystem/path.hpp> #include <boost/filesystem/operations.hpp> std::string exePath = boost::filesystem::initial_path<boost::filesystem::path>().string(); 这样就可以了.避免用win32 API这种又不友好也不跨平台的方式了.直接用boost舒服.…
C#获取文件的当前路径
C#获取文件的当前路径 1. System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName -获取模块的完整路径. 2.System.Environment.CurrentDirectory -获取和设置当前目录(该进程从中启动的目录)的完全限定目录. 3.System.IO.Directory.GetCurrentDirectory() -获取应用程序的当前工作目录.这个不一定是程序从中启动的目录啊, 4.System.A…
Delphi 获取进程路径及命令行参数
Delphi 获取进程路径及命令行参数, 但有的进程获取时会报错,不知为啥 type PVOID64 = UINT64; _UNICODE_STRING = packed record Length : USHORT; MaximumLength : USHORT; Buffer : PWideChar; end; UNICODE_STRING = _UNICODE_STRING; PUNICODE_STRING =^_UNICODE_STRING; _UNICODE_STRING64 = pa…
delphi 获取硬盘序列号、cpu号、bios号、网卡号
delphi 获取硬盘 序列号 function GetIdeNum: String; type TSrbIoControl = packed record HeaderLength : ULONG; Signature : Array[0..7] of Char; Timeout : ULONG; ControlCode : ULONG; ReturnCode : ULONG; Length : ULONG; end; SRB_IO_CONTROL = TSrbIoControl; PSrbI…
Delphi 获取当前鼠标下的控件内容
Delphi 获取当前鼠标下的控件内容 主要函数: GetCursorPos://获取鼠标的位置 WindowFromPoint://获取制定point下的handle GetClassName://获取类的名字 function TForm1.GetEditText: string;var Point: TPoint; Name: array[0..255] of Char; Buffer: array[0..1023] of Char; AHandle: THandle;begin …
Delphi获取本机的MAC地址
Delphi获取本机的MAC地址: uses NB30; function GetAdaPterInfo(lana: Char): string; var Adapter: TAdapterStatus; NCB: TNCB; begin FillChar(NCB,Sizeof(NCB),0); NCB.ncb_command := Char(NCBRESET); NCB.ncb_lana_num := Lana; if Netbios(@NCB) <> Char(…
Delphi获取其他exe程序版本号
delphi获取Exe文件版本信息的函数 Type TFileVersionInfo = Record FixedInfo:TVSFixedFileInfo; {版本信息} CompanyName:String; {公司名称} FileDescription:String; {说明} FileVersion:String; {文件版本} InternalName:String; {内部名称} LegalCopyright:String; {版权} LegalTrademarks:String;…
DELPHI获取宽带IP
DELPHI获取宽带IP DELPHI获取宽带IP procedure TForm1.Button1Click(Sender: TObject);varurl: string;beginurl := 'http://pv.sohu.com/cityjson?ie=utf-8';Memo1.Text := IdHTTP1.Get(url);end; http://whois.pconline.com.cn/ipJson.jsp 这个URL也能获取.…
Delphi获取默认打印机名称及端口
Delphi获取默认打印机名称及端口 在前段时间写的收银系统中由于目前市场上很多电脑主板上已经没有并口,而POS机却又需要并口,所以目前需要用PCI转接卡,这个就导致不同门店使用的端口就有可能不同,这就给我们程序中弹出钱箱的指令带来一定的难度.所以就通过获取Window自带的默认,得出打印机信息. 在Windows文件下有个win.ini,里面自带默认打印机的信息.通过调用API函数Getprofilestring这个函数获取打印机信息. 在界面上拖个button,在其单击事件中写: pro…