CLRInterop error : Getting infos

There is the code for show the complete error description instead the standard message : “Error Clr Interop”.

throw error(ClrInterop::getLastException().ToString());
Advertisements

Shell execute on batch server

There below the code for simule a ShellExecute method for the Batch:

server static void shellExecuteFTP(Filename _fileName, str _localFolder)
{
    #WinAPI
    
    System.Diagnostics.Process              process;
    System.Diagnostics.ProcessStartInfo     processStartInfo;
    ;

    new InteropPermission(InteropKind::ClrInterop).assert();

    process = new System.Diagnostics.Process();

    processStartInfo = new System.Diagnostics.ProcessStartInfo();
    processStartInfo.set_FileName(@"C:\WINDOWS\System32\ftp.exe");
    processStartInfo.set_Arguments(_fileName);
    processStartInfo.set_WorkingDirectory(_localFolder);

    process.set_StartInfo(processStartInfo);

    process.Start();

    //process.WaitForExit();
    process.Close();
}