.net 将文件保存到“我的文档”中的文件夹
我正在使用“保存文件”对话框从“数据网格”视图保存excel文件,并希望将文件保存在文档的文件夹中。然后,如果该文件夹不存在,将创建该文件夹。我该怎么做.net 将文件保存到“我的文档”中的文件夹,.net,vb.net,savefiledialog,.net,Vb.net,Savefiledialog,我正在使用“保存文件”对话框从“数据网格”视图保存excel文件,并希望将文件保存在文档的文件夹中。然后,如果该文件夹不存在,将创建该文件夹。我该怎么做 You can add your file path in we.config like this <appSettings> <add key="imagePath" value="D:\Image\Profile" /> </appSettings> if (!System.IO.Dir
You can add your file path in we.config like this
<appSettings>
<add key="imagePath" value="D:\Image\Profile" />
</appSettings>
if (!System.IO.Directory.Exists(strVirtualPath))
{
System.IO.Directory.CreateDirectory(strVirtualPath);
}
Dim myDocs = My.Computer.FileSystem.SpecialDirectories.MyDocuments
Dim dataDir = IO.Path.Combine(myDocs,"Data")
If Not IO.Directory.Exists(dataDir) Then IO.Directory.Create(dataDir)
fileDialog.InitialDirectory = dataDir
fileDialog.ShowDialog()