I want to find image path but I didn't.
my image path : C:\Works\Web5.1.0\Src\Works.WebNext\Password\assets\img my image name : reset_password.jpg
I tried this : string path2 = Path.GetFullPath("reset_password.jpg");
but it's wrong path (output: C:\Windows\System32\inetsrv)
and tried this :
string path = Path.GetDirectoryName(Assembly.GetExecutingAssembly().CodeBase);
string a = Path.Combine(path, "reset_password.jpg");
output : (C:\Works\Web5.1.0\Src\Works.WebNext\bin )
I think, output should be like this : C:\Works\Web5.1.0\Src\Works.WebNext\Password\assets\img
one more thing : image path may not be same another computer so I think give a specific path is not right (for example : C:\Works\Web5.1.0\Src\Works.WebNext\Password\assets\img )
X computer : C:\Works\Web5.1.0\Src\Works.WebNext\Password\assets\img
Y computer : C:\Works\Web\Src\Works.WebNext\Password\assets\img
By the way, I am writing with c#.
How can I do ? Any ideas please.
I'm not sure I've understood the issue but an idea of how to find the same file on many systems is:
AppDomain.CurrentDomain.BaseDirectory
This will give you the location of the folder that your running executable is in. The output is in the format of "C:\Folder\Folder\WindowsFormsApplication1\WindowsFormsApplication1\bin\Debug\".
So, you can put the image in the same folder as the .exe, add "imagefilename.type" and you should find it.
Please clarify if this doesn't answer your question.