Tech
Forums
Jobs
Books
Events
Videos
Conference
Annual Conference
Bcrypt
Ai Conference
Live
More
Interviews
Certification
Training
Career
Members
News
Blogs
Contribute
An Article
A Blog
A Video
An Ebook
An Interview Question
Register
Login
0
Answer
Q: Path parameter for running console app from network?
Ask a question
Ask a question
Upload Source Code:
Select only zip and rar file.
Brad
17y
1.9k
1
Reply
I've made a console app that takes as input a path to a file. One of the ways the app checks the validity is as follows:
if
(!
File
.Exists(sourcePath)) {
Console
.Out.WriteLine(sourcePath +
" is not a valid source path"
);
return
;
}
sourcePath value here is something like "C:\temp\sourceFile.moo"
This works fine for running the app locally(MachineA). However, if I place this app on my network (
\\MachineB\myApp.exe
) and then try running it from machineA again with the same exact parameter input and with the source file path unchanged, it breaks out at that part of the code.
What am I missing? It seems to me as if the code were being run entirely on machineB (which obviously is missing the sourceFile.moo) even though MachineA is calling it. Is this the case? If so, what could I do to explicitly tell it to look for the file on the machine that is calling the app, not the machine that the app is saved on.
My thanks to anyone with suggestions.
Post
Reset
Cancel
Answers (
0
)
Next Recommended Forum
How to get Remote Hard Disk Space Info(Logical Drive C:,D:) by Using C# in ASP.NET Application
Problem printing reports (Crystal Reports XI) using C# codes