将文件从本地计算机上载到服务器VB.NET [英] Upload File from local machine to a server VB.NET

查看:237
本文介绍了将文件从本地计算机上载到服务器VB.NET的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我有一个Windows应用程序需要将文件从本地机器上传到服务器。



我正在使用以下代码:



Hi,

I have a windows application which needs to upload a file from the local machine to the server.

I''m using the following code:

My.Computer.Network.UploadFile(pictureBox.ImageLocation, New Uri("file://Missa-HP/" + txtPhoto.Text + ".jpg"))





Missa-HP =我的电脑名称。



但我得到以下内容错误:



无法找到网络名称。



有谁能告诉我怎么解决这个问题错误?如果没有,是否有其他方式上传文件?



谢谢,

Missa,



Missa-HP = my computer name.

but I''m getting the following error:

The network name cannot be found.

can anyone tell me how can i resolve this error? and if not, is there another way to upload a file?

Thank you,
Missa,

推荐答案

您没有包含您要连接的共享名称。格式为:

You didn''t include the share name that you''re connecting to. The format is:
\\computerName\shareName\filepath





您的代码省略了shareName。



Your code omitted the shareName.


这篇关于将文件从本地计算机上载到服务器VB.NET的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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