Silverlight3 :使用SaveFileDialog保存到本地文件

private void SaveFileClick(object sender, RoutedEventArgs e) {     SaveFileDialog sfd = new SaveFileDialog()     {         DefaultExt = "txt",         Filter = "Text files (*.txt)|*.txt|All files (*.*)|*.*",         FilterIndex = 2     };     if (sfd.ShowDialog() == true)     {         FileName.Text = "文件名称:" + sfd.File.Name;         using (Stream stream = sfd.OpenFile())         {             Byte[] fileContent =  System.Text.UTF8Encoding.UTF8.GetBytes(Msg.Text);             stream.Write(fileContent, 0, fileContent.Length);             stream.Close();         }                     } }

你可能感兴趣的:(object,Stream,filter,silverlight,byte)