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 8132377
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T09:20:06+00:00 2026-06-06T09:20:06+00:00

I am developing an app right now that reads in data from a windows

  • 0

I am developing an app right now that reads in data from a windows from and generates an XML file based on the input.

I am tasked with creating a new file each time the form is updated (User presses “Submit”). (so far so good)

Here is the catch: The file has to be named after a prominent field input. (If the user types ‘993388CX’ in the text box, the app would rename the pending file 993388CX.xml).

I understand how to actually rename a file in C#, but not how to rename it based on a form’s input. Do any classes/methods exist that will dynamically rename the file based on the form input?

Code:

//Reads info1 from user input on the app UI and generates XML statement

        XTemp = XDoc.CreateElement("New_Info");
        XTemp.InnerText = info1.Text;
        Xsource.AppendChild(XTemp);

          XDoc.Save(@"C:\oldfile.xml");

I need the new file to be renamed after the string in info1.Text

If the user input was “John5”, the file needs renamed to john5.xml

Thank you

  • 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-06-06T09:20:08+00:00Added an answer on June 6, 2026 at 9:20 am

    Either directly save it with the correct name:

    XDoc.Save(String.Format("C:\\{0}.xml",info1.Text));
    

    OR

    Rename it afterwards

    File.Move("c:\\oldfile.xml", String.Format("C:\\{0}.xml",info1.Text));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am developing a windows mobile app. Right now I am just testing that
I'm developing a facebook app right now all by my lonesome. I'm attempting to
I'm developing a Grails App. I have about 20 Controllers right now and there
i am developing an android todo list app to learn. right now in my
I am developing an app right now which creates and stores a connection to
I'm developing an application the screen grab a thrid party app. Right now I've
I am developing an app that lets the user record videos and photos. Now
Right now, I'm developing an app for Mac OS and for iOS. I'd like
I'm looking into developing an application that will process data from a line-scan camera
i'm developing an app that make requests to the Musicbrainz webservice. I read in

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.