Click here to Skip to main content
15,949,686 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
in silverlight how to open a file and convert it to stream (dont use open filedialog/savefiledialog but use only path of the file in web)
can any one answer
Posted

Opening a file has nothing to do with dialogs. There is no "convert it to stream".
See System.IO. In most cases, you would use the class StreamReader or StreamWriter. These classes has underlying Stream as a property. You can construct instances of these classes with stream or a file name. Please see all the constructors and the help for further detail. Always use using block. There is no much difficulties in all this activity.

Generally, this works, but... please see also the Answer by Abhinav.

—SA
 
Share this answer
 
v3
Silverlight runs in a sandboxed environment.
You cannot do this in a web application.
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 4-Feb-11 0:46am    
Oops.
Thank you, Abhinav.
--SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900