Click here to Skip to main content
15,897,334 members
Home / Discussions / C#
   

C#

 
GeneralRe: Where to use Try/Catch block? Pin
Adam_Dev14-Sep-11 2:33
Adam_Dev14-Sep-11 2:33 
AnswerRe: Where to use Try/Catch block? Pin
Luc Pattyn14-Sep-11 2:51
sitebuilderLuc Pattyn14-Sep-11 2:51 
JokeArrayList Pin
Subodh Kumar Jain13-Sep-11 20:38
Subodh Kumar Jain13-Sep-11 20:38 
GeneralRe: ArrayList Pin
Wayne Gaylard13-Sep-11 21:04
professionalWayne Gaylard13-Sep-11 21:04 
GeneralRe: ArrayList Pin
PIEBALDconsult14-Sep-11 2:27
mvePIEBALDconsult14-Sep-11 2:27 
GeneralRe: ArrayList Pin
Pete O'Hanlon14-Sep-11 3:51
mvePete O'Hanlon14-Sep-11 3:51 
QuestionError in Custom IIS MMC SnapIn Page ...... Pin
Shazz_Shivang200413-Sep-11 20:23
Shazz_Shivang200413-Sep-11 20:23 
QuestionWho to write HTML code using Csharp Pin
amit_ghosh1813-Sep-11 8:20
amit_ghosh1813-Sep-11 8:20 
XML
private void button1_Click(object sender, EventArgs e)
       {
           string[] input = new string[] { "Web", "Images", "Gmail", "C:\\Users\\Amit_Personal\\Documents\\Visual Studio 2008\\Projects\\abc\\abc\\google_image_final.png", "Google Search", "I'm Lucky"};

           // Pass the array as a parameter:
           Designpage(input);
       }

       public void Designpage(string[] arr)
       {

           string fileLoc = @"C:\Users\Amit_Personal\Documents\Visual Studio 2008\Projects\abc\abc\a.htm";


                     if (File.Exists(fileLoc))
                     {
                         using (StreamWriter s = File.AppendText(fileLoc))
                   {

                       //  StringWriter s = new StringWriter();
                       s.WriteLine("{0}", "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\">");
                       s.WriteLine("{0}", "<html>");
                       s.WriteLine("{0}", "<title>Google</title>");
                       s.WriteLine("{0}", "<link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\">");
                       s.WriteLine("{0}", "</head>");
                       s.WriteLine("{0}", "<body>");


                       s.WriteLine("<h4>{0}&nbsp;", arr[0]);
                       s.Write("{0}&nbsp;", arr[1]);
                       s.WriteLine("{0}&nbsp;</h4>", arr[2]);
                       s.WriteLine("<img src=\"{0}\" />",arr[3]);



                       s.WriteLine("{0}", "</body>");
                       s.WriteLine("{0}", "</html>");
                       s.WriteLine("{0}", "");
                       s.Close();
                   }
               }



Any one Know how to write better code to generate a .html file using C# language..
AnswerRe: Who to write HTML code using Csharp Pin
Eddy Vluggen13-Sep-11 8:33
professionalEddy Vluggen13-Sep-11 8:33 
AnswerRe: Who to write HTML code using Csharp Pin
Matt Meyer13-Sep-11 8:44
Matt Meyer13-Sep-11 8:44 
AnswerRe: Who to write HTML code using Csharp Pin
Ian Shlasko13-Sep-11 8:52
Ian Shlasko13-Sep-11 8:52 
AnswerRe: Who to write HTML code using Csharp Pin
PIEBALDconsult13-Sep-11 10:30
mvePIEBALDconsult13-Sep-11 10:30 
AnswerRe: Who to write HTML code using Csharp Pin
BobJanova13-Sep-11 22:49
BobJanova13-Sep-11 22:49 
Questionasp.net 2010 toolbox items Pin
classy_dog13-Sep-11 3:59
classy_dog13-Sep-11 3:59 
AnswerRe: asp.net 2010 toolbox items Pin
BobJanova13-Sep-11 4:06
BobJanova13-Sep-11 4:06 
AnswerRe: asp.net 2010 toolbox items Pin
fjdiewornncalwe13-Sep-11 5:43
professionalfjdiewornncalwe13-Sep-11 5:43 
GeneralRe: asp.net 2010 toolbox items Pin
classy_dog13-Sep-11 6:44
classy_dog13-Sep-11 6:44 
GeneralRe: asp.net 2010 toolbox items Pin
Pete O'Hanlon13-Sep-11 7:24
mvePete O'Hanlon13-Sep-11 7:24 
GeneralRe: asp.net 2010 toolbox items Pin
classy_dog13-Sep-11 8:25
classy_dog13-Sep-11 8:25 
Questionhow to detect existence of .net framework and its version on a user's machine Pin
Danzy8313-Sep-11 2:30
Danzy8313-Sep-11 2:30 
AnswerRe: how to detect existence of .net framework and its version on a user's machine Pin
PIEBALDconsult13-Sep-11 2:35
mvePIEBALDconsult13-Sep-11 2:35 
GeneralRe: how to detect existence of .net framework and its version on a user's machine Pin
Danzy8313-Sep-11 2:48
Danzy8313-Sep-11 2:48 
GeneralRe: how to detect existence of .net framework and its version on a user's machine Pin
PIEBALDconsult13-Sep-11 3:10
mvePIEBALDconsult13-Sep-11 3:10 
AnswerRe: how to detect existence of .net framework and its version on a user's machine Pin
Wayne Gaylard13-Sep-11 2:47
professionalWayne Gaylard13-Sep-11 2:47 
GeneralRe: how to detect existence of .net framework and its version on a user's machine Pin
Danzy8313-Sep-11 2:51
Danzy8313-Sep-11 2:51 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.