网上做兼职正规网站,建物流网站,百度网址大全官网下载,唐山展望网站建设公文一键排版系统基本完成#xff0c;准备继续完善SysInfo#xff0c;增加用户帐户信息#xff0c;其中涉及到Win32_Account结构#xff0c;其C定义如下#xff1a;
[Dynamic, Provider(CIMWin32), UUID({8502C4CC-5FBB-11D2-AAC1-006008C78BC7}…公文一键排版系统基本完成准备继续完善SysInfo增加用户帐户信息其中涉及到Win32_Account结构其C定义如下
[Dynamic, Provider(CIMWin32), UUID({8502C4CC-5FBB-11D2-AAC1-006008C78BC7}), AMENDMENT]
class Win32_UserAccount : Win32_Account
{
uint32 AccountType;
string Caption;
string Description;
boolean Disabled;
string Domain;
string FullName;
datetime InstallDate;
boolean LocalAccount;
boolean Lockout;
string Name;
boolean PasswordChangeable;
boolean PasswordExpires;
boolean PasswordRequired;
string SID;
uint8 SIDType;
string Status;
}; 由于WMI使用的是UniCodeWCHAR所以我们在MASM32中要将以上成员属性AccountType、Caption……按DW UniCodeWCHAR来定义如下
AccountType dw A,c,c,o,u,n,t,T,y,p,e, 0, 0
Caption dw C,a,p,t,i,o,n, 0, 0
Description dw D,e,s,c,r,i,p,t,i,o,n, 0, 0
Disabled dw D,i,s,a,b,l,e,d, 0, 0
Domain dw D,o,m,a,i,n, 0, 0
FullName dw F,u,l,l,N,a,m,e, 0, 0
InstallDate dw I,n,s,t,a,l,l,D,a,t,e, 0, 0
LocalAccount dw L,o,c,a,l,A,c,c,o,u,n,t, 0, 0
Lockout dw L,o,c,k,o,u,t, 0, 0
Name dw N,a,m,e, 0, 0
PasswordChangeable dw P,a,s,s,w,o,r,d,C,h,a,n,g,e,a,b,l,e, 0, 0
PasswordExpires dw P,a,s,s,w,o,r,d,E,x,p,i,r,e,s, 0, 0
PasswordRequired dw P,a,s,s,w,o,r,d,R,e,q,u,i,r,e,d, 0, 0
SID dw S,I,D, 0, 0
SIDType dw S,I,D,T,y,p,e, 0, 0
Status dw S,t,a,t,u,s, 0, 0
虽然MASM32 在QEDITOR 的 Conversions里提供了Text to DW UNICODE菜单项功能但这个菜单项还不能实现自动从类中提出成员属性名称并转换为MASM32的DW UNICODE字符串的格式所以我们还是先得手工将AccountType、Caption……提取出来。
成员少还行成员多的话就太麻烦了。
于是用HTMLJavaScript写了一个简单的转换工具运行效果如下 完整代码如下
!DOCTYPE html
html langenheadmeta charsetUTF-8meta nameGenerator contentEditPlus®meta nameAuthor contentPurpleEndurermeta nameKeywords contentmeta nameDescription contenttitleANSI String 2 MASM32 DW UniCode String/title/headbodytable
captionP stylecolor:purple;font:18pt bold;ANSI String 2 MASM32 DW UniCode Stringnbsp;nbsp;input typebutton value转换 onclicktran()/P
/captiontrtdP aligncenterANSI 字符串/P/tdtdP aligncenterMASM32 DW UniCode String/P/td
/tr
trtdtextarea idtaAnsi rows50 cols40 alignleft
uint32 AccountType;
string Caption;
string Description;
boolean Disabled;
string Domain;
string FullName;
datetime InstallDate;
boolean LocalAccount;
boolean Lockout;
string Name;
boolean PasswordChangeable;
boolean PasswordExpires;
boolean PasswordRequired;
string SID;
uint8 SIDType;
string Status; /textarea /tdtdtextarea idtaUni rows50 cols90/textarea/td
/tr
/tablescript//功能删除字符串中的所有空格
//记录20230726创建
String.prototype.eliminateSpace function()
{return this.replace(/\s*/g,);
}//去除首尾空格
String.prototype.trim function()
{return this.replace(/(^\s*)|(\s*$)/g, ); /*var t this.replace(/(^\s*)|(\s*$)/g, ); return t t.replace(/(^nbsp;*)|(nbsp*$)/g, ); */
} //功能将ANSI字符串转换成MASM32 Unicode字符串//记录20230811建//输入sANSI字符串//输出MASM32 DW Unicode字符串function ansiStr2UniStr(s){var r s.split();//document.write(rbr); return dw r.join(,) , 0, 0;}//ansiStr2UniStr(s)function getItem(a)
{var s a.split( );var j 0;while (j s.length){if (s[j].eliminateSpace()){s.pop();}else{j;}}//whilereturn s;
} //getItem(a)var taAnsi document.getElementById(taAnsi);
var taUni document.getElementById(taUni);function tran()
{var a taAnsi.value.replace(\t, ).split(\n);for (var i 0; i a.length; i){a[i] a[i].trim();if (;a[i][a[i].length-1]){a[i]a[i].substr(0,a[i].length-1);}a[i] getItem(a[i]);if (1 a[i].length){taUni.value a[i][1] ansiStr2UniStr(a[i][1]) \n; }}//for
}//tran()/script/body
/html