C# API ShellExecute() Fonksiyonu

Posted: July 6, 2014 in C#
Tags: ,

ShellExecute() Fonksiyonu 6 parametreye sahiptir.

1.parametre-> handle numarası
2.parametre-> yapılacak islem
3.parametre-> secilen islemin uygulanacagı dosya

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Runtime.InteropServices;
using System.Diagnostics;

namespace WindowsFormsApplication13
{
public partial class Form1 : Form
{

[DllImport(“shell32”)]
public static extern int ShellExecute (int hWnd,string IpOperation,string IpFile,string IpParametre,string IpDirectory,int snShowCmd);
public Form1()
{
InitializeComponent();
}

private void Form1_Load(object sender, EventArgs e)
{

}
private void button1_Click(object sender, EventArgs e)
{
ShellExecute(0, “Open”, “C:\\bayram.txt”, “”, “”, 1);

}

private void button2_Click(object sender, EventArgs e)
{

ShellExecute(0, “Open”, “https://bayramtugcu.wordpress.com/”, “”, “”, 1);
}

}
}

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s