在网络上开发一个vb.net系统检索文件. [英] Develop a vb.net system retrive file on network.

查看:79
本文介绍了在网络上开发一个vb.net系统检索文件.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,我是vb.net的新手.我需要开发一个vb系统,它将检测同一网络中的计算机,并通过单击1按键从那些连接的计算机中的特定文件夹中下载文件.我可以知道vb.net代码可以完成吗,如果可以,您能告诉我完整的编码方式吗?谢谢您,如果我问愚蠢的问题,抱歉.

Hello, i''m a newbie in vb.net. i need to develop a vb system that will detect the computer in the same network and will download the file from those connected computer in particular folder with 1 button click. May i know can vb.net code done on it and if can, can u show me how with the full coding?Thank you and sorry if i asking stupid question.

推荐答案

您必须知道计算机名称和共享名称,但这很简单:

You have to know the machine name and the share name, but it''s as simple as this:

File.Copy("\\machinename\sharename\folder\filename.ext", "c:\temp\filename.ext")



编辑=====================

如果您按下按钮以使复制发生,并且您知道文件所在的计算机,则为什么需要自动检测"该文件?您可以轻松地设置尝试/捕获机制,并且引发异常(由计算机不在线或无法找到文件引起),请做出相应反应.

这不是火箭手术.



EDIT =======================

If you''re pushing a button to cause the copy to happen, and you know the machine the file is on, why do you need to ''auto-detect" it? You can easily setup a try/catch mechanism and if an exception is thrown (caused by the machine not being online or the file not otherwise be able to be found), react accordingly.

It ain''t rocket surgery.


这篇关于在网络上开发一个vb.net系统检索文件.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆