3 Replies - 10259 Views - Last Post: 29 December 2009 - 07:34 AM Rate Topic: -----

#1 Pablo3728  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 69
  • Joined: 13-October 09

Create HTML file

Post icon  Posted 24 December 2009 - 07:09 AM

HI, I have an application in vb 2005, and I want to create one html file. THe problema is that, I have the code of the html in a String (html_aux) and I want to create the html with this code:

Create new html
html code = html_aux

I donīt know how Can I do this, If somebody can help me would be great!

Thank you! :)

Pablo

Is This A Good Question/Topic? 0
  • +

Replies To: Create HTML file

#2 AdamSpeight2008  Icon User is offline

  • MrCupOfT
  • member icon


Reputation: 2264
  • View blog
  • Posts: 9,469
  • Joined: 29-May 08

Re: Create HTML file

Posted 24 December 2009 - 07:57 AM

I don't quite understand what your saying. To be if you the string html_aux contains the html code, then isn't already created?
Or are you saying you got some html code and you want to display it.
Was This Post Helpful? 0
  • +
  • -

#3 jhouns  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 25
  • View blog
  • Posts: 100
  • Joined: 21-December 09

Re: Create HTML file

Posted 29 December 2009 - 04:05 AM

View PostAdamSpeight2008, on 24 Dec, 2009 - 06:57 AM, said:

I don't quite understand what your saying.

I think he's saying he has the html code kept in a string call html_aux and he wishes to save it as a file (such as 'index.html').
So surely it is just simply writing it to a file the same as a text document and adding '.html' instead of '.txt'

		Dim s As New System.IO.StreamWriter("C:\Index.html", False)
		If System.IO.File.Exists("C:\Index.html") Then
			s.WriteLine(html_aux)
			s.Close()
		Else
			MkDir("c:\Index.html")
			s.WriteLine(html_aux)
			s.Close()




or something like that, the above may not work but its close enough for you to get working good luck
Was This Post Helpful? 1
  • +
  • -

#4 Pablo3728  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 69
  • Joined: 13-October 09

Re: Create HTML file

Posted 29 December 2009 - 07:34 AM

It is exactly this! Thank you very match! :)
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1