# VB.NET Read from project resource? Possible?



## psyko12 (Sep 22, 2010)

```
_Process = New Process
        _Process.StartInfo.FileName = "exe.exe"
        _Process.StartInfo.Arguments = "-f " & My.Resources.Config 
        _Process.StartInfo.UseShellExecute = False
        _Process.StartInfo.RedirectStandardOutput = True
        _Process.StartInfo.CreateNoWindow = True
        AddHandler _Process.OutputDataReceived, AddressOf UpdateTextBox
        _Process.Start()
```

The code above is wrong, ehehe  just wondering if it was possible to may my exe.exe read the contents of his config file from the projects res file.

Or do I need it to write it to a tempo location so exe.exe can read and then delete it afterwards, or if it was modified by exe.exe write it back to itself. Sorry been studying and trying out codes I apologize if you guys are having hard time understanding what I want to do...    

TIA!


----------



## FordGT90Concept (Sep 22, 2010)

You don't run it is a process, you load it as a resource.

Add the executable as a resource to your project.  If VS takes it, you can work with resources inside the executable if they are public.  If VS rejects it, it is not a .NET compatible binary.

The executable must be in the same directory as your executable to work.

If VS took it, you should be able to access it like you would any .NET DLL (like System).  It will most likely be Imports <executable name>.Resources.Config.


----------



## psyko12 (Sep 23, 2010)

Ahh thank you! Now I get it. Lol... Btw I was asking also if for example my exe.exe is in a folder eg. Bin\exe.exe

I call it from my .net application and I need exe.exe to read a config file from resource within the .net app.. is that possible?


----------



## FordGT90Concept (Sep 24, 2010)

Depends if the methods for doing so are public or not.


----------

