Foxtable(狐表)用户栏目专家坐堂 → [求助]网络列表


  共有2673人关注过本帖平板打印复制链接

主题:[求助]网络列表

帅哥哟,离线,有人找我吗?
大红袍
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:贵宾 帖子:39310 积分:196782 威望:0 精华:1 注册:2015/4/25 9:23:00
  发帖心情 Post By:2015/7/24 15:19:00 [只看该作者]

写错了,那个是获取数据库服务器的。下面这些可以

 

Dim p As new Process()
p.StartInfo.FileName = "cmd.exe"
p.StartInfo.UseShellExecute = False '关闭Shell的使用
p.StartInfo.RedirectStandardInput = True '重定向标准输入
p.StartInfo.RedirectStandardOutput = True '重定向标准输出
p.StartInfo.RedirectStandardError = True '重定向错误输出
p.StartInfo.CreateNoWindow = True '设置不显示窗口
p.Start()

p.StandardInput.WriteLine("net view")
p.StandardInput.WriteLine("exit")
Dim strRst As String = p.StandardOutput.ReadToEnd()

msgbox(strrst)

Dim ary() As String = strrst.replace(chr(10), "").Split(chr(13))
For Each s As String In ary
    If s.StartsWith("\\") Then
        msgbox(s)
    End If
Next

 

 

http://www.cnblogs.com/luoht/archive/2009/12/18/1627431.html

 


 回到顶部
总数 11 1 2 下一页