Saltar al contenido principal

use OpenFileDialog in "Dynamic code (.NET SDK" type universal function

Comentarios

2 comentarios

  • Brian Watts

    I'm also running into this issue

  • Dave Dai

    I later found that you can use a new process to do this.  

    The code for universal function would be like follows. choose-file.exe would be a simple application that displays the choose file dialog and outputs the filename to console.  

    Directory.SetCurrentDirectory("D:\\Debug"); // this is where choose-file.exe is 
    var process = new Process{
        StartInfo = new ProcessStartInfo{
            FileName = "choose-file.exe",
            UseShellExecute = false,
            RedirectStandardOutput = true,
            CreateNoWindow = true
        }
    };
    process.Start();
    while (!process.StandardOutput.EndOfStream)
    {
        var line = process.StandardOutput.ReadLine();
        application.StatusBar.SetText(line);
    }
    process.WaitForExit();

Iniciar sesión para dejar un comentario.