vb.net 上传文件到服务器的指定活页夹目录下,路径怎么写. 急!!! 在线等待......

sullywang 2008-08-05 11:28:07
vb.net 上传文件到服务器的指定活页夹目录下,路径怎么写. 急!!! 在线等待......
...全文
343 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
HANTANGXUETOMS 2010-08-26
  • 打赏
  • 举报
回复
好像是下载代码,请问上传啊!
LYDF4151 2008-08-06
  • 打赏
  • 举报
回复
dim withevents mywebclient as new system.net.webclient

Private Sub Button1_click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

Dim fod As New System.Windows.Forms.OpenFileDialog

If fod.ShowDialog = Windows.Forms.DialogResult.OK Then
'MsgBox(System.IO.Path.GetFileName(fod.FileName).ToString)

Dim isa As Boolean = My.Computer.Network.IsAvailable
If isa = True Then
Dim remoteUri As String = fod.FileName
mywebclient = New System.Net.WebClient

Dim fileName As String
fileName = "c:\" + System.IO.Path.GetFileName(fod.FileName)
mywebclient.DownloadFileAsync(New Uri(remoteUri), fileName)
Dim FmDB As Integer
FmDB = FileLen(fileName) / 1024
Me.ProgressBar1.Maximum = 100
Me.ProgressBar1.Minimum = 0
Me.ProgressBar1.Step = 1
Else
MsgBox("电脑网络未连接.不能使用该功能")
End If

End If
End Sub

Private Sub myWebclient_DownloadProgressChanged(ByVal sender As Object, ByVal e As System.Net.DownloadProgressChangedEventArgs) Handles mywebclient.DownloadProgressChanged

Static ssd As Integer
ssd = (e.BytesReceived - ssd) / 1024
Label1.Text = "已下载:" & CInt((e.BytesReceived / 1024).ToString) & "KB"
Label2.Text = "文件大小:" & CInt((e.TotalBytesToReceive / 1024).ToString) & "KB"
Label3.Text = "已完成:" & e.ProgressPercentage.ToString & "%"
Label4.Text = "速度:" & ssd & "KB/秒"
ssd = e.BytesReceived
Me.ProgressBar1.Value = e.ProgressPercentage
End Sub
CloneCenter 2008-08-05
  • 打赏
  • 举报
回复
在指定的目录下创建文件就可以了。
OOQQOO 2008-08-05
  • 打赏
  • 举报
回复
学习

16,717

社区成员

发帖
与我相关
我的任务
社区描述
VB技术相关讨论,主要为经典vb,即VB6.0
社区管理员
  • VB.NET
  • 水哥阿乐
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧