I have an application that imports XML files. If the DTD for the incoming XML file is missing, I need to write it to the import directory and restart the import routine.
So, I am storing the DTD in the application as an embedded resource. I can get the DTD into a stream instance using the following code:
Now that I have the DTD into a stream, how do I write it to a file on disk?
Do I need a filestream + writer, or what? It's been too long since I did this.
So, I am storing the DTD in the application as an embedded resource. I can get the DTD into a stream instance using the following code:
VB.NET:
'Get DTD from embedded resource
Dim assy As Assembly = Assembly.GetExecutingAssembly()
Dim manifestResource As String = String.Empty
manifestResource = "myapp.GENERAL_1.dtd"
Dim strDTD As Stream = assy.GetManifestResourceStream(manifestResource)
Now that I have the DTD into a stream, how do I write it to a file on disk?
Do I need a filestream + writer, or what? It's been too long since I did this.