Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

System.Diagnostics.Process & Dual-Server Environment

2 views
Skip to first unread message

Will Asrari

unread,
Jul 30, 2006, 7:09:10 PM7/30/06
to
In my code I have created a Process for opening up a command line
executable using System.Diagnostics.Process that imports a csv full of
Generic Authorization account information to numerous tables (SQL). When
the executable resides on the same server as my application the import
works fine. When my application is executed a new text file is created
in the folder listed below. The process arguments ent=1 and store=1 know
to look in ent001/store001 for the import file. I know it is possible to
create and open a file in a single-server environment as I have tested
this. What would I need to do (permissions, sharing, etc...) to allow
the creation and importation of the csv file in a dual-server
environment? The servers will always be on the same network.

Thanks in advance,

- Will

..
// write CSV file
TextWriter tw = new
StreamWriter(@"\\server\ent001\store001\ga_imp2.txt", false,
UnicodeEncoding.Default);
tw.WriteLine(yada + "," + yada + "," + yada);

ImportGA();

private void ImportGA()
{
Process proc = new Process();
proc.EnableRaisingEvents = false;
proc.StartInfo.Arguments = "/Ent=1 /Store=1";
proc.StartInfo.WorkingDirectory = @"\\server\share\sys_exe";
proc.StartInfo.FileName = "ga_imp2.exe";

try
{
proc.Start();
}

catch(Exception ex)
{
GCM.Reference.UpdateLogFile(ex.ToString());
}

finally
{
proc.Close();
}
}

*** Sent via Developersdex http://www.developersdex.com ***

0 new messages