Question: In a c# code, how do I display a line from a text file containing a string with a number and store the number as

In a c# code, how do I display a line from a text file containing a string with a number and store the number as a variable in the c# code, and then update the line in the text file with the data from the function.

text file format:

count 1 : 3

count 2: 1

count 3: 7

Total count: 11

function script:

var count1;

var count2;

var count3;

var total

var disp1;

var disp2;

var disp3;

var dispttl;

function choice1() {

count1 += 1;

}

function choice2() {

count2 += 1;

}

function choice3() {

count3 += 1;

}

function disp() {

string disp1 = "Count 1 : " + count1;

document.getElementById("count1").innerHTML = disp1;

string disp2 = "Count 2 : " + count2;

document.getElementById("count2").innerHTML = disp2;

string disp3 = "Count 3: " + count3;

document.getElementById("count3").innerHTML = disp3;

string dispttl = "Total Count : " + (count1 + count2 + count3);

document.getElementById("ttlcount").innerHTML = dispttl;

}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!