Skip to main content
Home Forums Silverlight Programming Programming with .NET - General How to create text file in silverlight (In server side)
3 replies. Latest Post by Amanda Wang - MSFT on December 26, 2008.
(0)
vrrengas123
Member
0 points
4 Posts
12-22-2008 9:36 AM |
Hi,
How to create the text file in server side with specified path. In which I want to store the error log information.
With Regards
Renganathan.R
prujohn
Contributor
3567 points
703 Posts
12-22-2008 9:44 AM |
Use the System.IO.File namespace to Create/Read/Update/Delete your files. You can use HostingEnvironment.ApplicationPhysicalPath to get the root path of your web app, and then create directories/files from there (assuming you have set permissions). Then setup a web service, to receive the log events from Silverlight client(s).
12-22-2008 11:52 PM |
Hi Jhon
f.Write(info, 0, info.Length);
f.Close();
Amanda W...
All-Star
17241 points
1,466 Posts
12-26-2008 2:44 AM |
Hi Renganathan,
Due to Silverlight runs on client side, if you want to create a fine in the silverlight, the file will be created on the client machine.
So if you want to create a file in your server you need a Web Service or WebClient.OpenWrite function + ASPX page or IHttpHandler to do that.
You can try to refer the discussion about this here: http://silverlight.net/forums/t/22456.aspx