国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 開發 > 綜合 > 正文

C#獲取硬盤序列號

2024-07-21 02:19:19
字體:
來源:轉載
供稿:網友
注冊會員,創建你的web開發資料庫,using system;
using system.runtime.interopservices;

namespace arli.commonprj {

#region how use this?
/*
string svol = getvol.getvolof("c");
*/
#endregion

public class getvol{

[dllimport("kernel32.dll")]
private static extern int getvolumeinformation(
string lprootpathname,
string lpvolumenamebuffer,
int nvolumenamesize,
ref int lpvolumeserialnumber,
int lpmaximumcomponentlength,
int lpfilesystemflags,
string lpfilesystemnamebuffer,
int nfilesystemnamesize
);

public static string getvolof(string drvid){
const int max_filename_len = 256;
int retval = 0;
int a =0;
int b =0;
string str1 = null;
string str2 = null;


int i = getvolumeinformation(
drvid + @":/",
str1,
max_filename_len,
ref retval,
a,
b,
str2,
max_filename_len
);

return retval.tostring("x");
}
}
}


發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 康马县| 秭归县| 平定县| 延边| 盐边县| 闸北区| 乌什县| 酒泉市| 盖州市| 威远县| 林口县| 嘉祥县| 卓资县| 寿宁县| 永吉县| 疏附县| 连城县| 阳朔县| 万州区| 习水县| 彭泽县| 白银市| 剑阁县| 文成县| 荣昌县| 准格尔旗| 永川市| 丰台区| 凌海市| 太湖县| 中方县| 疏附县| 南澳县| 朔州市| 建始县| 镇沅| 阿尔山市| 义马市| 民权县| 连云港市| 射阳县|