We do not do your homework: it is set for a reason. It is there so that you think about what you have been told, and try to understand it. It is also there so that your tutor can identify areas where you are weak, and focus more attention on remedial action.
So just posting a cut down version of your homework question and saying "I tried" isn;t going to get you anywhere.
Creating HTML as a text string is trivial in C#:
string html = "<div style=\"margin-top:25px\">Hi all <br>I" +
" am beginner on coding. I want to make a program that i can insert details of building" +
" and than create the graphic control panel. Structure of graphic control panel is" +
" same, but there is different number of floor on each graphic.<br>" +
"<br>PLEASE HELP!! This is my school project<br><br><b>What I have tried:</b><br>" +
"<br>I am trying to create txt of html to make it but it seem did not work</div>";
Try it yourself, you may find it is not as difficult as you think!
If you meet a specific problem, then please ask about that and we will do our best to help. But we aren't going to do it all for you!
Look at your code:
for (int i = 1; i <= 10; i++) ;
StreamWriter File = new StreamWriter(i);
File.Write("<div style=\"margin-top:25px\">Hi all I" +
" am beginner on coding. I want to make a program that i can insert details of building" +
" and than create the graphic control panel. Structure of graphic control panel is" +
" same, but there is different number of floor on each graphic." +
"PLEASE HELP!! This is my school projectWhat I have tried:" +
"I am trying to create txt of html to make it but it seem did not work");
File.Close();
The first line:
for (int i = 1; i <= 10; i++) ;
The semicolon terminates the loop - so the lines below that are executed once, and only when the loop is finished. So
i
will always have the same value: 11.
Except... since
i
is declared as local to the
for
loop, it won't exist for the second line!
And even if it did, the StreamWriter constructor does not have a overload which takes an integer value.
Remove the semicolon; add curly brackets; convert the integer to a string. And it's a good idea to specify a valid folder to store the files in, plus give them a "sensible" extension:
for (int i = 1; i <= 10; i++)
{
StreamWriter File = new StreamWriter(string.Format(@"D:\Temp\{0}.txt", i.ToString()));
File.Write("<div style=\"margin-top:25px\">Hi all I" +
" am beginner on coding. I want to make a program that i can insert details of building" +
" and than create the graphic control panel. Structure of graphic control panel is" +
" same, but there is different number of floor on each graphic." +
" PLEASE HELP!! This is my school project. What I have tried:" +
" I am trying to create txt of html to make it but it seem did not work");
File.Close();
}
This kind of stuff is pretty basic, and I can't help thinking that you are trying to run before you can walk...