以文本方式查看主题 - Foxtable(狐表) (http://foxtable.com/bbs/index.asp) -- 专家坐堂 (http://foxtable.com/bbs/list.asp?boardid=2) ---- [求助]网络列表 (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=72154) |
-- 作者:blsu33 -- 发布时间:2015/7/24 13:44:00 -- [求助]网络列表 红袍老师, 如何实现显示网络电脑列表 如下图
|
-- 作者:blsu33 -- 发布时间:2015/7/24 13:48:00 -- 例子 如何写呢
|
-- 作者:大红袍 -- 发布时间:2015/7/24 14:07:00 -- Dim instance As System.Data.Sql.SqlDataSourceEnumerator = System.Data.Sql.SqlDataSourceEnumerator.Instance
|
-- 作者:blsu33 -- 发布时间:2015/7/24 14:29:00 -- 红袍老师, 测试 只显示本机 哦 想显示局域网所有的电脑 供选择 怎么写
|
-- 作者:大红袍 -- 发布时间:2015/7/24 15:06:00 --
[此贴子已经被作者于2015/7/24 15:07:07编辑过]
|
-- 作者:大红袍 -- 发布时间:2015/7/24 15:19:00 -- 写错了,那个是获取数据库服务器的。下面这些可以
Dim p As new Process() p.StandardInput.WriteLine("net view") msgbox(strrst) Dim ary() As String = strrst.replace(chr(10), "").Split(chr(13))
http://www.cnblogs.com/luoht/archive/2009/12/18/1627431.html
|
-- 作者:blsu33 -- 发布时间:2015/7/24 15:52:00 -- 红袍老师, 我把这个代码写到listview 不显示 应该怎么写 Dim lsw As WinForm.ListView = e.Form.Controls("ListView1") lsw.Rows.Clear() lsw.Images.Clear() 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() Dim ary() As String = strrst.replace(chr(10), "").Split(chr(13)) For Each s As String In ary If s.StartsWith("\\\\") Then lsw.Images.AddImage(s,"电脑.Ico","电脑.Ico") End If Next |
-- 作者:大红袍 -- 发布时间:2015/7/24 16:14:00 -- Dim lvw As WinForm.ListView = e.Form.Controls("ListView1")
|
-- 作者:blsu33 -- 发布时间:2015/7/24 17:42:00 -- 哦 实现了 谢谢老师 但问题还有一个 就是lisiview 返回的值 显示的 是这样 pull8878 zhangsan 感觉像是网络名+计算机名 能否只要前面的网络名 pull8878
|
-- 作者:大红袍 -- 发布时间:2015/7/24 17:44:00 -- r.Text = s.split(" ")(0) \'指定行的标题 |