Click here to Skip to main content
15,886,078 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I want to increment the version of the file when the user clicks button. file version must increment from 1000 to 10001. which means it will be writing to the file every time you click a button.

I want this version to increment from 1000 to 10001 every-time you click new button.

XML
<resheader name="version">
    <value>2.0</value>
  </resheader>
  <resheader name="reader">


my coding below. i am lost on how i can update the file version. please help


XML
int versionNumber = 1000;
public void versionIncrement()
{
            versionNumber++;
            lbl_Output_Version.Text = versionNumber.ToString();
            lbl_Output_Version.Visible = true;}
}
Posted
Updated 12-Feb-15 4:21am
v5
Comments
Herman<T>.Instance 12-Feb-15 9:53am    
Why?
johannesnestler 12-Feb-15 10:49am    
So what's the exact problem?, Writing to a file (XML it seems)? Your code justs updates a Label. So a just a general advice: Represent your XML as an object you can serialize (write/read to a file with one call). Read the XML to obtain the current file Version, update file Version on your button click and write the file again.
ChrisCreateBoss 12-Feb-15 23:11pm    
I agree with @johannesnestler. You have to read the xml file to update any changes in it, you are just changing the text of a label each time you click the button. However, you can easily use Text files as your updating source, it is easier to write and read them.

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