【发布时间】:2012-02-29 08:15:54
【问题描述】:
我想将 silverlight 中的文件保存(上传)到 silverlight 应用程序文件夹中。
我得到了应用程序的 URI
string str3 = App.Current.Host.Source.AbsoluteUri + "/Recording/";
但我不知道如何保存文件。
我用这个代码.....
string extension = "wav";
// Create an instance of the open file dialog box.
OpenFileDialog openFileDialog1 = new OpenFileDialog();
// Set filter options and filter index.
openFileDialog1.Filter = String.Format("{1} files (*.{0})|*.{0}|WAV FILES (*.*)|*.*", extension, "Audio");
openFileDialog1.FilterIndex = 1;
openFileDialog1.Multiselect = false;
// Call the ShowDialog method to show the dialog box.
bool? userClickedOK = openFileDialog1.ShowDialog();
// Process input if the user clicked OK.
if (userClickedOK == true)
{
string str = App.Current.Host.Source.AbsoluteUri + "/Recording/";
openFileDialog1.File.CopyTo(str);
}
【问题讨论】:
标签: silverlight upload