Sign in to follow this  
Followers 0
MattXu

in C#, how to implement Function like "ShellExecute(string fileName"?

3 posts in this topic

hello:

in script, I have code like this:

#include <Constants.au3>
#include <Date.au3>
#include <ScreenCapture.au3>
 
ShellExecute("C:BlueHills.jpg")
 
by running this script, windows will use a default application to open this picture, but how to do it in C#? All I can find is AutoItX.Run(....);
 
using AutoIt;
using System;

namespace ConsoleApplication2
{
    class Program
    {
        static void Main(string[] args)
        {
            AutoItX.Run("ss.png", @"C:\Users\XuChun\Pictures");            
            Console.ReadLine();
        }
    }
}

AutoItX.Run() can only execute an .exe application, it can't find a default application to open my picture

I didn't find ShellExecute() in AutoIt .Net lib, or did I miss something?

 

What can I do?

thanks

 

Share this post


Link to post
Share on other sites



Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0