以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  网络邻居访问foxdb文件,如何登录  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=79783)

--  作者:Fotable
--  发布时间:2016/1/8 17:43:00
--  网络邻居访问foxdb文件,如何登录
程序文件和数据库文件是放在单位的网络邻居共享里面,需要用户名登录

这时运行程序会弹出错误


图片点击可在新窗口打开查看此主题相关图片如下:2016-01-08_174718.jpg
图片点击可在新窗口打开查看


--  作者:Fotable
--  发布时间:2016/1/8 17:45:00
--  
如何实现网络邻居共享的登录呢
--  作者:大红袍
--  发布时间:2016/1/8 17:45:00
--  
shell( "net use \\\\192.168.44.202\\ 密码 /user:用户名",0)
--  作者:大红袍
--  发布时间:2016/1/8 17:46: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 use  \\\\192.168.44.202\\ TBFCfs.2109 /user:Administrator")
p.StandardInput.WriteLine("exit")

--  作者:Fotable
--  发布时间:2016/1/9 14:42:00
--  
谢谢 原来是通过命令行方式实现