J
James
Hi all,
I am new to ASP.NET. I am currently working on a project with VB, .NET
1.1 on
a Windows 2000 server.
I have two files
C:\Inetpub\wwwroot\test\test.aspx
C:\Inetpub\wwwroot\test\test.exe
test.exe is a C program, it will be executed if the user click the
button in test.aspx page.
some code from test.aspx
....
Dim fname As String = Server.MapPath("test.exe")
Dim cmdline As String = fname & " > c:\temp\stdout.txt 2>
c:\temp\stderr.txt"
Dim retval As Integer
retval = Shell(Environ("COMSPEC") & " /c " & cmdline, AppWinStyle.Hide,
True, 100000)
....
I redirect stdout and stderr of test.exe to two files. Initially I want
to redirect them to
C:\Inetpub\wwwroot\test\stdout.txt, and
C:\Inetpub\wwwroot\test\stderr.txt, but failed.
It looks like the program does not have permissions to write to
C:\Inetpub\wwwroot\test\
directory. So I have to redirect them to c:\temp, where "Everyone" has
read&write
permissions, which is not secure. Even worse, the program cannot write
new data to
stdout.txt, neither can I delete the file manually. It says "There has
been a sharing
violation. The source or destination file may be in use"
My question is what kind of permissions should I give to directories
and files, and
where I should store files.
Thanks,
James
I am new to ASP.NET. I am currently working on a project with VB, .NET
1.1 on
a Windows 2000 server.
I have two files
C:\Inetpub\wwwroot\test\test.aspx
C:\Inetpub\wwwroot\test\test.exe
test.exe is a C program, it will be executed if the user click the
button in test.aspx page.
some code from test.aspx
....
Dim fname As String = Server.MapPath("test.exe")
Dim cmdline As String = fname & " > c:\temp\stdout.txt 2>
c:\temp\stderr.txt"
Dim retval As Integer
retval = Shell(Environ("COMSPEC") & " /c " & cmdline, AppWinStyle.Hide,
True, 100000)
....
I redirect stdout and stderr of test.exe to two files. Initially I want
to redirect them to
C:\Inetpub\wwwroot\test\stdout.txt, and
C:\Inetpub\wwwroot\test\stderr.txt, but failed.
It looks like the program does not have permissions to write to
C:\Inetpub\wwwroot\test\
directory. So I have to redirect them to c:\temp, where "Everyone" has
read&write
permissions, which is not secure. Even worse, the program cannot write
new data to
stdout.txt, neither can I delete the file manually. It says "There has
been a sharing
violation. The source or destination file may be in use"
My question is what kind of permissions should I give to directories
and files, and
where I should store files.
Thanks,
James