在C#或VB.Net中,有一种方法可以找到程序集中包含的嵌入资源吗?
因为我以这种方式手动从组件中提取嵌入资源:
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
我想在未来的项目中自动完成任务,在不知道确切名称的情况下提取资源,这是可能的吗?