Jump to content

Help needed to Browse for Network Resources


Recommended Posts

I've been looking through the forums and the help file for information on browsing a network for machines but have not been successful.

I am working on a client that can connect to an application running on a remote server. However, instead of having the user enter the machine name or ip address I'd prefer to offer a select drop-down containing all the machine names of servers available on the network.

If you have any thoughts or could point me in the right direction I'd be greatful.

Thank you!

ABB

Link to comment
Share on other sites

This is what I am currently doing to achieve this but don't think it's the best solution. Please help.

$machineList = GUICtrlCreateCombo("Select ...",77,57,235,200)
$cmdNetView = RunWait(@ComSpec & " /c net view>netview.log", "", @SW_HIDE)
If Not _FileReadToArray("netview.log",$aRecords) Then
   fnWriteLog("Error reading netview.log to array: " & @error)
EndIf
For $x = 1 to $aRecords[0]
   If StringLen($aRecords[$x]) <> 0 Then
      If StringInStr($aRecords[$x],"\\") Then
         $aFoo = StringSplit($aRecords[$x]," ")
         $bar = $bar & $aFoo[1] & "|"
      EndIf
   EndIf
Next
GUICtrlSetData($machineList,$bar)
FileDelete("netview.log")
Edited by abb
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...