0

Ussing vb.net I extract an image from another exe using the following code.

My question is, is it also possible to extract a setting value from another exe using a simular method?

Try
Dim ExternalAssembly As Assembly = Assembly.LoadFile(Application.StartupPath & "/" & PluginPath)
Dim TargetPlugin As String = IO.Path.GetFileNameWithoutExtension(Application.StartupPath & "/" & PluginPath)
Dim ExternalResourceManager As Resources.ResourceManager

ExternalResourceManager = New Resources.ResourceManager(TargetPlugin & ".resources", ExternalAssembly)

If ExternalResourceManager.GetObject("MyStringRefrenceName") = Nothing Then
.Image = My.Resources.ResourceManager.GetString("MyStringRefrenceName").testing 'or is it value?

Msgbox(MyStringRefrenceName)

End If

 Catch ex As Exception

Msgbox("failed")

End Try
LabRat
  • 1,996
  • 11
  • 56
  • 91
  • Yes, it is possible – Caius Jard Sep 13 '21 at 09:27
  • Okay ... what I have managed to see is that there are also String references however if I reference there name in the above code change getobject to getstring and obviously replace .image= to somthing like msgbox(TheObjectName) I get a catch error? – LabRat Sep 13 '21 at 09:58
  • Settings aren't resources. Have you tried reading the MSDN documentation on settings? – Craig Sep 13 '21 at 13:28
  • yeah though in resorces there are also strings and I was hoping to access them? – LabRat Sep 13 '21 at 16:06

0 Answers0