以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  复制文件  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=129069)

--  作者:联友
--  发布时间:2018/12/20 19:04:00
--  复制文件
将Attachments文件复制到自选路径,请老师指教代码,谢谢!
Dim dlg As New OpenFileDialog
Dim fn As String = ProjectPath & "Attachments\\学生基本信息.xls"
If dlg.ShowDialog = DialogResult.OK Then
    代码?
End If
[此贴子已经被作者于2018/12/20 19:46:25编辑过]

--  作者:有点甜
--  发布时间:2018/12/20 20:26:00
--  

Dim dlg As New saveFileDialog

If dlg.ShowDialog = DialogResult.OK Then
    Dim fn As String = ProjectPath & "Attachments\\学生基本信息.xls"
    FileSys.CopyFile(fn, dlg.FileName, True)
End If


--  作者:联友
--  发布时间:2018/12/20 21:01:00
--  
谢谢!
--  作者:联友
--  发布时间:2019/1/4 19:50:00
--  

老师还想请教,打开文档,文件名自动输入“学生基本信息”,请指教,谢谢!

 

Dim dlg As New saveFileDialog

If dlg.ShowDialog = DialogResult.OK Then
    Dim fn As String = ProjectPath & "Attachments\\学生基本信息.xls"
    FileSys.CopyFile(fn, dlg.FileName, True)

代码?
End If


此主题相关图片如下:qq截图20190104194049.png
按此在新窗口浏览图片

--  作者:有点蓝
--  发布时间:2019/1/4 20:46:00
--  

Dim dlg As New saveFileDialog
dlg.FileName = "学生基本信息.xls"
……

--  作者:联友
--  发布时间:2019/1/4 21:15:00
--  
谢谢