自定义ClickOnce应用程序的默认网页

时间:2009-01-28 14:06:31

标签: asp.net vb.net deployment clickonce

桑德,为此写了一篇相关文章......

http://todotnet.com/archive/2005/10/11/2595.aspx

遗憾的是,代码是在C#中。

哪个是vb.net版本的equivelant?

2 个答案:

答案 0 :(得分:2)

使用http://www.developerfusion.com/tools/convert/csharp-to-vb/转换

Imports System.Net
Imports System.Xml.Xsl  
Imports System.Net

Dim request As HttpWebRequest = DirectCast(HttpWebRequest.Create("...url to the original publish.htm file..."), HttpWebRequest)
Dim response As HttpWebResponse = DirectCast(request.GetResponse(), HttpWebResponse)
Dim dataStream As Stream = response.GetResponseStream()
Dim reader As New StreamReader(dataStream)
Dim responseFromServer As String = reader.ReadToEnd()

responseFromServer = responseFromServer.Replace(" ", " ")

Dim xml As New System.Xml.XmlDocument()
xml.LoadXml(responseFromServer)

Dim xslt As New XslCompiledTransform()
Dim html As TextWriter = New StringWriter()
xslt.Load(Server.MapPath("CustomPublish.xsl"))
xslt.Transform(xml, Nothing, html)

Response.Write(html.ToString())
Response.[End]()

让我知道它是否有效。

答案 1 :(得分:0)

Response.Write(html.ToString())

大写。

请评论answers并查看最佳答案,以便我们保持联系。