In C# or else VB.Net, there is a way to find the embedded resource(s) contained in an assembly?
Because I'm manually extracting an embedded resource form an assembly in this way:
Dim embeddedFileName As String = "MyResources.resx"
Dim targetFilePath As String = "C:\NewMyResources.resx"
Using s As Stream = assembly.GetManifestResourceStream(embeddedFileName)
Dim buffer As Byte() = New Byte(CInt(s.Length - 1)) {}
Dim read As Integer = s.Read(buffer, 0, CInt(s.Length))
Using fs As New FileStream(targetFilePath, FileMode.Create)
fs.Write(buffer, 0, buffer.Length)
End Using
End Using
I would like to automate the task in future projects to extract the resource(s) without knowing the exact name(s), it is possible?
You can get a list of embedded resources with the Assembly.GetManifestResourceNames method.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With