我使用c#silverlight! 我不知道如何獲得從SaveFileDialog中選擇的「路徑」可以有人幫助嗎?SaveFileDialog獲取路徑選擇
SaveFileDialog saveFileDialog = new SaveFileDialog();
saveFileDialog.DefaultFileName = fileName;
saveFileDialog.Filter = "Pdf files (*.Pdf)|*.Pdf";
saveFileDialog.DefaultExt = "pdf";
if (saveFileDialog.ShowDialog() == true)
{
string path = "";// find a way to get path selected
}
THX
您是否注意到Silverlight標籤? – Steve 2014-12-03 13:45:53
我試試 string fileName = saveFileDialog.SafeFileName; string Path = saveFileDialog.File.DirectoryName; 但我不能訪問文件 – Noxs 2014-12-03 13:52:50
看來你不能得到完整的路徑出於安全原因。 [鏈接](http://msdn.microsoft.com/it-it/library/system.windows.controls.savefiledialog.safefilename%28v=vs.95%29.aspx) – dario 2014-12-03 13:56:10