|
| ||||||||||
| Tags: framework, openfiledialog, silverlight, web component |
![]() |
| | Thread Tools | Search this Thread |
|
#1
| |||
| |||
| OpenFileDialog in SilverLight
I am writing prog C # with Silverlight, a dialog box to download the file, other than 'that I need to get the file name and path to file as a string, the file name but the way I do not know it is not working. Do you have any sample code for this? Any help will be great. Thank you. |
|
#2
| |||
| |||
| Re: OpenFileDialog in SilverLight
Hello, Try the following code Code: OpenFileDialog opfld = new OpenFileDialog();
opfld.Multiselect = false;
opfld.Filter = "All Files |*.*";
if (opfld.ShowDialog() == True)
(
System.IO.FileInfo fl = opfld .File;
string fileName = fl.Name;
/ / Call to the Next Swearing, such as forbidden
d=fl.Directory
) |
|
#3
| |||
| |||
| Re: OpenFileDialog in SilverLight
I have changed the above code and this is in more advanced form. Code: OpenFileDialog opfld = new OpenFileDialog();
opfld.Multiselect = false;
opfld.Filter = "All Files |*.*";
if (opfld.ShowDialog() == DialogResult.OK)
(
/ / fl path
string path = opfld.FileName;
) |
|
#4
| |||
| |||
| Re: OpenFileDialog in SilverLight Code: / / File path string path = OFD.FileName; |
|
#5
| |||
| |||
| Re: OpenFileDialog in SilverLight
Here's an example correctly, the OpenFileDialog in Silverlight (build System.Windows.Controls, namespace System.Windows.Controls) Code: OpenFileDialog Dialog = new OpenFileDialog(); Code: DirectoryInfo dirInfo = Dialog.File.Directory; string nameInfo = Dialog.File.DirectoryName; |
|
#6
| |||
| |||
| Re: OpenFileDialog in SilverLight
via JavaScript and I got this way, but this does not help to solve the main problem - I need to copy the file to the server ... CAN this be done Via JScript? Silverlight markups below do Not allow to do with the files .... |
|
#7
| |||
| |||
| Re: OpenFileDialog in SilverLight
Silverlight application runs in the sandbox .. Just got the name and path you do not do it. In-class dialog to open a file must be property in which remains something like FileStream (file stream). Reads its contents and sends it to server. Or, once more through ActiveX and JavaScript |
|
#8
| |||
| |||
| Re: OpenFileDialog in SilverLight
The same applies to the conservation .. You open a dialogue - it is an addition, dialogue, save more and asking the user to bypass the security system for a specific individual file. Therefore, the class file dialogue in SL modified so that you do not get the file path, but you get access to it through a copy of the file dialog. They took from it a file stream and write-read. The user you solved it, by clicking on OK in the dialog. |
![]() |
|
| Thread Tools | Search this Thread |
| |
Similar Threads for: "OpenFileDialog in SilverLight" | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Silverlight 5 released; will there be a Silverlight 6? | GopuHD | Windows Software | 4 | 11-01-2012 01:28 PM |
| While installing Silverlight I get "Silverlight is already installed" message | Raja Ram | Windows Software | 5 | 28-04-2011 10:27 AM |
| How to install SilverLight 5 beta and SilverLight 4 on same Computer | Mandarmalika | Windows Software | 3 | 17-04-2011 04:55 PM |
| XAML Processing Differences Between Silverlight 3 and Silverlight 4 | wllwnn | Guides & Tutorials | 2 | 09-08-2010 09:41 AM |
| What is SilverLight? | Champak | Windows Software | 4 | 31-01-2009 09:21 AM |