2013-09-21 188 views

回答

2
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() 
-1
You can add your file path in we.config like this 
    <appSettings> 
    <add key="imagePath" value="D:\Image\Profile" /> 
    </appSettings> 

然後在代碼寫:

串strVirtualPath = ConfigurationManager.AppSettings [ 「的ImagePath」];

if (!System.IO.Directory.Exists(strVirtualPath)) 
{ 
    System.IO.Directory.CreateDirectory(strVirtualPath); 
} 
相關問題