PB 如何获取电脑上的U盘盘符?或者有谁帮忙用PB翻译一下Delphi代码
如题:
网上搜了下都是通过调用API函数来实现,但是PB调用GetLogicalDrives时获取不到想要的值。
GetLogicalDrives
getdrivetype
下边是Delphi处理代码
u盘盘符判断
procedure TForm1.Button1Click(Sender: TObject);
var
buf:array [0..max_path-1] of char;
m_result:integer;
i:integer;
str_temp:string;
begin
m_result:=getlogicaldrivestrings(max_path,buf);
for i:=0 to (m_result div 4) do
begin
str_temp:=string(buf[i*4]+buf[i*4+1]+buf[i*4+2]);
if getdrivetype(pchar(str_temp)) = drive_removable then
begin
showmessage(str_temp+'盘为u盘') ;
listbox1.items.add(str_temp) ;
end;
end;
参考自:http://qqhack8.blog.163.com/blog/static/1141479852012102133475/
网上搜了下都是通过调用API函数来实现,但是PB调用GetLogicalDrives时获取不到想要的值。
GetLogicalDrives
getdrivetype
下边是Delphi处理代码
u盘盘符判断
procedure TForm1.Button1Click(Sender: TObject);
var
buf:array [0..max_path-1] of char;
m_result:integer;
i:integer;
str_temp:string;
begin
m_result:=getlogicaldrivestrings(max_path,buf);
for i:=0 to (m_result div 4) do
begin
str_temp:=string(buf[i*4]+buf[i*4+1]+buf[i*4+2]);
if getdrivetype(pchar(str_temp)) = drive_removable then
begin
showmessage(str_temp+'盘为u盘') ;
listbox1.items.add(str_temp) ;
end;
end;
参考自:http://qqhack8.blog.163.com/blog/static/1141479852012102133475/
...全文
相关推荐
加密狗 U盾 身份验证 JAVA C++ PB VB DELPHI 例子程序
加密狗 U盾 身份验证 JAVA C++ PB VB DELPHI 例子程序
pb例子,数据库连接
pb例子pb例子,数据库连接 源代码 pb例子pb例子,数据库连接 源代码
D3 D3-U 读写器开发接口及调试程序
D&C德卡D3及D3-U射频卡读写器开发接口及调试工具,安装后在安装文件夹下可找到DELPHI C# FOXPRO PB调用的范例。
华视CVR100U二次开发SDK开发Demo示例
包含VC(包含永久居留证) Demo、VB demo、PB demo、Java Demo、Delphi Demo、C++Builder Demo、C# Demo。 本资源将详细演示在C#中对华视电子的二代身份证读卡器进行二次开发。 编程环境中,为了实现对这类硬件的控制和数据交互,开发者通常需要进行二次开发,即编写特定的软件接口或者驱动程序。
isoplot使用指南-下载即用.zip
源码直接下载地址: https://pan.quark.cn/s/fadcbc1d0dd0 该软件在各类数据处理方面表现优异,使用起来十分便捷。 通过观看相关指南,用户能够迅速掌握该软件的操作方法。


API 调用
