VFP 愛用者社區 首頁 VFP 愛用者社區
本討論區為 Visual Foxpro 愛用者經驗交流的地方, 請多多利用"搜尋"的功能, 先查看看有無前例可循, 如果還有不懂的再發問. 部份主題有附加檔案, 須先註冊成為社區居民才可以下載.
 
 常見問題常見問題   搜尋搜尋   會員列表會員列表   會員群組會員群組   會員註冊會員註冊 
 個人資料個人資料   登入檢查您的私人訊息登入檢查您的私人訊息   登入登入

查某台電腦所有的分享名稱

 
發表新主題   回覆主題    VFP 愛用者社區 首頁 -> VFP 討論區
上一篇主題 :: 下一篇主題  
發表人 內容
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.

_________________
利用>>搜尋<<的功能會比問的還要快得到答案.
回頂端
檢視會員個人資料 發送私人訊息 發送電子郵件
從之前的文章開始顯示:   
發表新主題   回覆主題    VFP 愛用者社區 首頁 -> VFP 討論區 所有的時間均為 台北時間 (GMT + 8 小時)
1頁(共1頁)

 
前往:  
無法 在這個版面發表文章
無法 在這個版面回覆文章
無法 在這個版面編輯文章
無法 在這個版面刪除文章
無法 在這個版面進行投票
無法 在這個版面附加檔案
無法 在這個版面下載檔案


Powered by phpBB © 2001, 2005 phpBB Group
正體中文語系由 phpbb-tw 維護製作