Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 983455
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T04:51:35+00:00 2026-05-16T04:51:35+00:00

I am currently using xml as a config file for my silverlight application. I

  • 0

I am currently using xml as a config file for my silverlight application.
I have no problem reading the file, but now that I also require to update the file through web(preferably silverlight as will show preview of font colors, size etc), the only method I thought of is to generate the whole file and overwrite the existing through uploading.

Is there an easier way to do so?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T04:51:35+00:00Added an answer on May 16, 2026 at 4:51 am

    Well, found my own answer, sharing here too.

    When I read the xml file, I’m using linq’s for xml.
    So there is an option for doc.save()
    So by doing this:

    System.Xml.Linq.XDocument doc = System.Xml.Linq.XDocument.Parse(s);
    
    System.Text.StringBuilder sb = new System.Text.StringBuilder();
    System.IO.StringWriter sr = new System.IO.StringWriter(sb);
    doc.Save(sr);
    string ss = sb.ToString();//result
    sr.Close();
    

    I have got a saved xml file in ss.
    Then using web client’s OpenWriteCompleted,I used

    Stream outputStream = e.Result;
    byte[] fileContent = Encoding.UTF8.GetBytes(ss);
    outputStream.Write(fileContent, 0, fileContent.Length);
    outputStream.Close();
    

    Using web client’s OpenWriteAsync, the URI will be the uri of my generic handler.
    Inside the generic handler

    FileStream fs = File.Open(context.Server.MapPath("~/ClientBin/" + "test.txt"), FileMode.Create);
    
    byte[] buffer = new byte[4096];
    int bytesRead;
    while ((bytesRead = context.Request.InputStream.Read(buffer, 0, buffer.Length)) != 0)
    {
       fs.Write(buffer, 0, bytesRead);
    }
    fs.Close();
    

    credit to the author ( Nipun Tomar) @ as most of the ideas came from his site

    http://www.c-sharpcorner.com/UploadFile/nipuntomar/FileUploadsilverlight03182009030537AM/FileUploadsilverlight.aspx

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm reading some XML with PHP and currently using the DOMDocument class to do
All, I have a config xml file in the following format: <?xml version=1.0?> <configdata>
I have an app.config file inside my TestProject, but when I try to read
Is there an Android equivalent of .NET's application.config? I am currently using a values
I have an WinForms application that is deployed using Visual Studio 2008's publish (ClickOnce)
I have a client that generates its app.config using a Service Reference to a
I'm currently using the toprettyxml() function of the xml.dom module in a Python script
we're currently generating all our official documents using XSL-FO transformation using .xml files as
My current setup using hibernate uses the hibernate.reveng.xml file to generate the various hbm.xml
Currently using System.Web.UI.WebControls.FileUpload wrapped in our own control. We have licenses for Telerik. I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.