>>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