正如问题所述,我尝试使用XmlWriter
定义为与共享文档站点相关联的 http 地址的目标。XmlWriter
我将如何使用或不使用发送文件XmlWriter
?
Dim resolver As XmlUrlResolver = New XmlUrlResolver()
resolver.Credentials = CredentialCache.DefaultCredentials
Dim doc As New XmlDocument
doc.XmlResolver = resolver
Dim feedWriter As XmlWriter = XmlWriter.Create("URL")
Select Case format
Case FeedFormats.Atom
Response.ContentType = "application/rss+xml"
Dim atomFormatter As New Atom10FeedFormatter(feed)
atomFormatter.WriteTo(feedWriter)
Case FeedFormats.Rss
Response.ContentType = "application/atom+xml"
Dim rssFormatter As New Rss20FeedFormatter(feed)
rssFormatter.WriteTo(feedWriter)
End Select
doc.Save(feedWriter)
feedWriter.Close()
这是一个片段,我没有添加我的案例或提要声明,但这是不必要的。我想这应该用输出流来完成,但我不知道该怎么做。