FOR EACH oItem IN oItems
Diskinfo1 = LEFT(RIGHT(oItem.Caption,12),10)
IF LEN(ALLTRIM(diskinfo1))=10
EXIT
ENDIF
ENDFOR
*用ASC()函数将用户名中所有字符的ASCII码都取出来并连接成一个字符串
for m=1 to len(alltrim(diskinfo1))
thisstr=substr(alltrim(diskinfo1),m,1) &&取出一个字符
newnamenumber1=newnamenumber1+alltrim(str(asc(thisstr)))
endfor
NewNameNumber1=padl(newnamenumber1,10,"0")
CPKJ=val(NewNameNumber1)
IF !USED("register")
USE register
ENDIF
SELECT register
IF ISNULL(rname) OR LEN(ALLTRIM(rname))=0
thisname="江南" &&取得用户名
ELSE
thisname = ALLTRIM(rname)
ENDIF
*用ASC()函数将用户名中所有字符的ASCII码都取出来并连接成一个字符串
for m=1 to len(alltrim(thisname))
thisstr=substr(alltrim(thisname),m,1) &&取出一个字符
newnamenumber=newnamenumber+alltrim(str(asc(thisstr)))
endfor
NewNameNumber=padl(newnamenumber,10,"0")
NAM=val(NewNameNumber)
LOCAL oWbemLocator, oWMIService, oItems, oItem
oWbemLocator = CREATEOBJECT("WbemScripting.SWbemLocator")
oWMIService = oWbemLocator.ConnectServer(".", "root/cimv2")
*oItems = oWMIService.ExecQuery("SELECT Caption FROM " + "Win32_DiskDrive")
oItems = oWMIService.ExecQuery("SELECT Caption FROM " + "Win32_DiskDrive")
FOR EACH oItem IN oItems
Diskinfo1 = LEFT(RIGHT(oItem.Caption,12),10)
IF LEN(ALLTRIM(diskinfo1))=10
EXIT
ENDIF
ENDFOR
*用ASC()函数将用户名中所有字符的ASCII码都取出来并连接成一个字符串
for m=1 to len(alltrim(diskinfo1))
thisstr=substr(alltrim(diskinfo1),m,1) &&取出一个字符
newnamenumber1=newnamenumber1+alltrim(str(asc(thisstr)))
endfor
NewNameNumber1=padl(newnamenumber1,10,"0")
CPKJ=val(NewNameNumber1)
thisname = ALLTRIM(thisform.text1.Value)
*用ASC()函数将用户名中所有字符的ASCII码都取出来并连接成一个字符串
for m=1 to len(alltrim(thisname))
thisstr=substr(alltrim(thisname),m,1) &&取出一个字符
newnamenumber=newnamenumber+alltrim(str(asc(thisstr)))
endfor
NewNameNumber=thisform.text3.Value///编辑框用来输入别的机器的机器码
//在这里直接给NewNameNumber赋值成别的机器的机器码