TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Brad
NA
3
0
Q: Path parameter for running console app from network?
Nov 13 2006 6:49 PM
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.
Reply
Answers (
0
)
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