Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
ShellExecute to a C# exe fails - Access is denied
Message
From
12/10/2006 17:10:41
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
ASP.NET
Category:
Other
Environment versions
Environment:
C# 2.0
OS:
Windows XP SP2
Miscellaneous
Thread ID:
01161572
Message ID:
01161576
Views:
12
>>Why? Some sort of security as it seems but where to adjust?
>>
>>Reproducing:
>>
>>
>>using System;
>>using System.IO;
>>
>>class test
>>{
>>  [STAThread]
>>  static void Main()
>>  {
>>     using (StreamWriter wr = new StreamWriter(@"c:\temp\test.txt"))
>>      {
>>         sw.WriteLine("Hello from C#");
>>      }
>>  }
>>}
>>
Compile with csc and try to ShellExecute from say VFP. Fails with error code 5.
>>PS: Executing account is member of Administrators. Tried ngen install too.
>>TIA
>>Cetin
>
>Cetin,
>
>I wanted to try to help you but end up asking you for help :). To run the code you have above, do you create WinForm project, right? Then, where do you put the code? (Sorry for very newbie question).

No. There is no project. That's the all code:)
-Write in notepad.exe
-Go to VS2005 command prompt
csc mytest.cs
myTest.exe

It works. Now try ShellExecuting from VFP. It doesn't and return code is 5 (access denied).
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform