ประกาศExternal function ครับ ตามนี้
FUNCTION long GetComputerNameA(ref string ComputerName, ref ulong BufferLength) LIBRARY "KERNEL32.DLL"
FUNCTION long GetUserNameA(ref string UserName, ref ulong BufferLength) LIBRARY "ADVAPI32.DLL"
จากนั้น ก็ทำตามตัวอย่างครับ
long ll_ret
string ls_ComputerName, ls_UserName
ulong BufferLength = 250 // you may need to adjust this. see Note
ls_ComputerName = Space(BufferLength)
ls_UserName = Space(BufferLength)
ll_ret = GetComputerNameA(ls_ComputerName, BufferLength)
ll_ret = GetuserNameA(ls_UserName, BufferLength)
messagebox('username=',ls_UserName)
messagebox('Computer name=',ls_ComputerName)
ผมลองบน PB8 os XPpro sp2 user ไม่ขึ้นครับ
หา computer และuser name
Latest News
- บทที่ 7-1 ตอน การสร้างระบบฐานข้อมูล
- บทที่ 6 ทดลองเขียนโปรแกรมด้วย PocketBuilder เบื้องต้น
- บทที่ 4 ติดตั้งdatabase sql anywhere
- บทที่ 7-2 ตอน การสร้างโปรแกรมแสดงรายการอาหารที่สั่ง ด้วย Powerbuilder 9
- บทที่ 3 ติดตั้งอุปกรณ์ และโปรแกรม Active Sync
- ทำชุด setup โปรแกรมด้วย Wise Install
- การติดตั้ง IIS
- ตัวอย่าง code โปรแกรมร้านเช่า VDO
- สมาชิก : 2
- Content : 336
- เว็บลิงก์ : 8
- จำนวนครั้งเปิดดูบทความ : 159009


