JAVA程序中点击按钮打开文件对话框

[复制链接]
查看11 | 回复0 | 2007-12-29 16:17:42 | 显示全部楼层 |阅读模式
1.打开文件 Dim clsIntCmn As New WxsIntCmn
Dim strpath As String = txtPath.Text
clsIntCmn.Openfile(strpath, Page)
System.Diagnostics.Process.Start(strpath)2.上传文件Public Function Savefile(ByVal strFilepath As String, ByVal Request As HttpFileCollection) As Boolean
Dim bolflag As Boolean = True
Dim uploadedFiles As HttpFileCollection = Request
For i As Integer = 0 To uploadedFiles.Count - 1
Dim userPostedFile As HttpPostedFile = uploadedFiles(i)
Try
'要保存文件的路径
Dim strPath As String = strFilepath & "\" & _
System.IO.Path.GetFileName(userPostedFile.FileName)
If (userPostedFile.ContentLength > 0) Then
'保存文件
userPostedFile.SaveAs(strPath)
End If
txtPath.Text = strPath
txtDelPath.Text = strPath
Catch ex As Exception
bolflag = False
i = uploadedFiles.Count
End Try
Next
Return bolflag
End Function这是我曾经写过的,也已经用过,试试吧!应该可以帮助你的,不过你要改用一下语言
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行