 |
VFP 愛用者社區 本討論區為 Visual Foxpro 愛用者經驗交流的地方, 請多多利用"搜尋"的功能, 先查看看有無前例可循, 如果還有不懂的再發問. 部份主題有附加檔案, 須先註冊成為社區居民才可以下載.
|
上一篇主題 :: 下一篇主題 |
發表人 |
內容 |
garfield Site Admin

註冊時間: 2003-01-30 文章: 2160
第 1 樓
|
發表於: 星期四 九月 15, 2005 5:22 pm 文章主題: 查某台電腦所有的分享名稱 |
|
|
分享的數量 = ANETRESOURCES( 結果存放陣列名, 網路中的電腦名稱, 分享的種類 )
例:
mpc = '\\server'
mtotal = ANETRESOURCES( a_share , mpc , 1 )
? mpc ,'分享的資料夾'
for i=1 to mtotal
? a_chare[i]
next
?
mtotal = ANETRESOURCES( a_share , mpc , 2 )
? mpc ,'分享的印表機'
for i=1 to mtotal
? a_chare[i]
next
return
*********原 help
Places the names of network shares or printers into an array and then returns the number of resources.
ANETRESOURCES(ArrayName, cNetworkName, nResourceType)
Parameters
ArrayName
Specifies the name of the array containing the network share or printer information. If the array you specify doesn't exist, Visual FoxPro automatically creates the array. If the array exists and isn't large enough to contain all the information, Visual FoxPro automatically increases the size of the array to accommodate the information. If the array is larger than necessary, Visual FoxPro truncates the array. If the array exists and ANETRESOURCES( ) returns 0 because no network shares or printers are found, the array remains unchanged. If the array doesn't exist and ANETRESOURCES( ) returns 0, the array isn't created.
cNetworkName
Specifies the name of the network or domain for which share or printer information is returned. The network name should be in the format "\\NetworkName." You do not have to be connected to the network you specify, and specifying a network doesn't connect you to the network. If you specify a domain name, ANETRESOURCES( ) returns an array of members or resources from that domain.
nResourceType
Specifies the type of network resource for which information is returned. The names of shares on the network are returned if nResourceType evaluates to 1. The names of printers on the network are returned if nResourceType evaluates to 2. A value of 0 returns the name of any resource. _________________ 利用>>搜尋<<的功能會比問的還要快得到答案. |
|
回頂端 |
|
 |
|
|
您 無法 在這個版面發表文章 您 無法 在這個版面回覆文章 您 無法 在這個版面編輯文章 您 無法 在這個版面刪除文章 您 無法 在這個版面進行投票 您 無法 在這個版面附加檔案 您 無法 在這個版面下載檔案
|
|