File in a string...Don't openfile...

T

Trint Smith

I need to store an entire html file in a string and not call it from a
file.
Is that possible?? How can I do this?? with rows double quotes and
all...It needs to be something like this:

Dim file As String = "<html xmlns:v="urn:schemas-microsoft-com:vml"
xmlns:blush:="urn:schemas-microsoft-com:blush:ffice:blush:ffice"
xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882"
xmlns:b="urn:schemas-microsoft-com:blush:ffice:publisher"
xmlns="http://www.w3.org/TR/REC-html40">
<head>
<!-- ZoneLabs Privacy Insertion -->
<script language='javascript'
src='http://127.0.0.1:3001/js.cgi?pcaw&r=18114'></script>
<!-- ZoneLabs Privacy Insertion -->
<script language='javascript'
src='http://127.0.0.1:3001/js.cgi?pcaw&r=27088'></script>
<meta http-equiv=Content-Type content="text/html; charset=windows-1252">
<meta name=ProgId content=Publisher.Document>
<meta name=Generator content="Microsoft Publisher 11">
<link rel=File-List href="default_files/filelist.xml">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
b\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]--><!--[if gte mso 9]><xml>
<o:DocumentProperties>
<o:Author>trinity</o:Author>
<o:Version>11.5606</o:Version>
</o:DocumentProperties>
</xml><![endif]--><!--[if pub]><xml>
<b:publication type="OplPub" oty="68" oh="256">
<b:OhPrintBlock priv="30E">285</b:OhPrintBlock>
<b:FWebPublication priv="C00">True</b:FWebPublication>
<b:DptlPageDimensions type="OplPt" priv="1211">
<b:Xl priv="104">7772400</b:Xl>
<b:Yl priv="204">43891200</b:Yl>
</b:DptlPageDimensions>
</td>
</tr>
</table>
</div>
</body>
</html>
<!-- ZoneLabs Popup Blocking Insertion -->
<script language='javascript'>postamble();</script>
<!-- ZoneLabs Popup Blocking Insertion -->
<script language='javascript'>postamble();</script>
"

.Net programmer
(e-mail address removed)
 
C

Cor

Hi Trint,

I would do it in this way

Dim file As String = "<html xmlns:v=""urn:schemas-microsoft-com:vml"" " &
vbCrLf & _
"xmlns:blush:=""urn:schemas-microsoft-com:blush:ffice:blush:ffice"" " & vbCrLf & _
"xmlns:dt=""uuid:C2F41010-65B3-11d1-A29F-00AA00C14882"" " & vbCrLf & _
"xmlns:b=""urn:schemas-microsoft-com:blush:ffice:publisher"" " & vbCrLf & _
"xmlns=""http://www.w3.org/TR/REC-html40""> " & vbCrLf & _
"<head> " & vbCrLf & _
"<!-- ZoneLabs Privacy Insertion --> " & vbCrLf & _
"<script language='javascript' " & vbCrLf & _
"src='http://127.0.0.1:3001/js.cgi?pcaw&r=18114'></script> " & vbCrLf & _
"<!-- ZoneLabs Privacy Insertion --> " & vbCrLf & _
"<script language='javascript' " & vbCrLf & _
"src='http://127.0.0.1:3001/js.cgi?pcaw&r=27088'></script> " & vbCrLf & _
"<meta http-equiv=Content-Type content=""text/html; charset=windows-1252"">
" & vbCrLf & _
"<meta name=ProgId content=Publisher.Document> " & vbCrLf & _
"<meta name=Generator content=""Microsoft Publisher 11""> " & vbCrLf & _
"<link rel=File-List href=""default_files/filelist.xml""> " & vbCrLf & _
"<!--[if !mso]> " & vbCrLf & _
"<style> " & vbCrLf & _
"v\:* {behavior:url(#default#VML);} " & vbCrLf & _
"o\:* {behavior:url(#default#VML);} " & vbCrLf & _
"b\:* {behavior:url(#default#VML);} " & vbCrLf & _
"shape {behavior:url(#default#VML);} " & vbCrLf & _
"</style> " & vbCrLf & _
"<![endif]--><!--[if gte mso 9]><xml> " & vbCrLf & _
" <o:DocumentProperties> " & vbCrLf & _
" <o:Author>trinity</o:Author> " & vbCrLf & _
" <o:Version>11.5606</o:Version> " & vbCrLf & _
" </o:DocumentProperties> " & vbCrLf & _
"</xml><![endif]--><!--[if pub]><xml> " & vbCrLf & _
" <b:publication type=""OplPub"" oty=""68"" oh=""256""> " & vbCrLf & _
" <b:OhPrintBlock priv=""30E"">285</b:OhPrintBlock> " & vbCrLf & _
" <b:FWebPublication priv=""C00"">True</b:FWebPublication> " & vbCrLf & _
" <b:DptlPageDimensions type=""OplPt"" priv=""1211""> " & vbCrLf & _
" <b:Xl priv=""104"">7772400</b:Xl> " & vbCrLf & _
" <b:Yl priv=""204"">43891200</b:Yl> " & vbCrLf & _
" </b:DptlPageDimensions> " & vbCrLf & _
" <b:OhGallery priv=""180E"">259</b:OhGallery> " & vbCrLf & _
"style='color:#0066FF;font-weight:bold;language:EN'><o:p></o:p></span></p "
& vbCrLf & _
"> " & vbCrLf & _
" </td> " & vbCrLf & _
" </tr> " & vbCrLf & _
"</table> " & vbCrLf & _
"</div> " & vbCrLf & _
"</body> " & vbCrLf & _
"</html> " & vbCrLf & _
"<!-- ZoneLabs Popup Blocking Insertion --> " & vbCrLf & _
"<script language='javascript'>postamble();</script> " & vbCrLf & _
"<!-- ZoneLabs Popup Blocking Insertion --> " & vbCrLf & _
"<script language='javascript'>postamble();</script>"

I hope this helps?

Cor

Dim file As String = "<html xmlns:v="urn:schemas-microsoft-com:vml"
xmlns:blush:="urn:schemas-microsoft-com:blush:ffice:blush:ffice"
xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882"
xmlns:b="urn:schemas-microsoft-com:blush:ffice:publisher"
xmlns="http://www.w3.org/TR/REC-html40">
<head>
<!-- ZoneLabs Privacy Insertion -->
<script language='javascript'
src='http://127.0.0.1:3001/js.cgi?pcaw&r=18114'></script>
<!-- ZoneLabs Privacy Insertion -->
<script language='javascript'
src='http://127.0.0.1:3001/js.cgi?pcaw&r=27088'></script>
<meta http-equiv=Content-Type content="text/html; charset=windows-1252">
<meta name=ProgId content=Publisher.Document>
<meta name=Generator content="Microsoft Publisher 11">
<link rel=File-List href="default_files/filelist.xml">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
b\:* {behavior:url(#default#VML);}
shape {behavior:url(#default#VML);}
</style>
<![endif]--><!--[if gte mso 9]><xml>
<o:DocumentProperties>
<o:Author>trinity</o:Author>
<o:Version>11.5606</o:Version>
</o:DocumentProperties>
</xml><![endif]--><!--[if pub]><xml>
<b:publication type="OplPub" oty="68" oh="256">
<b:OhPrintBlock priv="30E">285</b:OhPrintBlock>
<b:FWebPublication priv="C00">True</b:FWebPublication>
<b:DptlPageDimensions type="OplPt" priv="1211">
<b:Xl priv="104">7772400</b:Xl>
<b:Yl priv="204">43891200</b:Yl>
</b:DptlPageDimensions>
</td>
</tr>
</table>
</div>
</body>
</html>
<!-- ZoneLabs Popup Blocking Insertion -->
<script language='javascript'>postamble();</script>
<!-- ZoneLabs Popup Blocking Insertion -->
<script language='javascript'>postamble();</script>
"

Net programmer
(e-mail address removed)
 
T

Tom Shelton

I need to store an entire html file in a string and not call it from a
file.
Is that possible?? How can I do this?? with rows double quotes and
all...It needs to be something like this:

Sure it's possible... Just make sure you double up your quotes :)

dim s as string = "<html>...<body bgcolor=""black"">...</body></html>"

You may also want to also look at the System.IO.StringStream class as
well.

HTH
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top