Tình hình là mình muốn mở Windows Media Player bằng cách click chuột vào 1 button của windows form nhưng làm chưa dk mình làm thế này. ai biết xin chỉ giáo nha.
Mã:
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;
namespace aa
{
public partial class Form1 : Form
{
[DllImport("Kernel32.dll")]
[DllImport("wmp.dll")]
public static extern uint WinExec(string path, uint uCmdShow);
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
WinExec("wmplayer.exe", 1);
}
}
}
Sao thằng bạn nó mở Remote Desktop Conection dk nhỉ,code của nó.
Mã:
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;
namespace aa
{
public partial class Form1 : Form
{
[DllImport("Kernel32.dll")]
public static extern uint WinExec(string path, uint uCmdShow);
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
WinExec("mstsc.exe", 1);
}
}
}
View more random threads:
Không chỉ dừng lại ở việc sử dụng nguyên liệu cao cấp, mỗi công trình còn được "chăm sóc" bằng 4 dịch vụ xuất sắc của Tre Nghệ. Từ việc tư vấn, thiết kế đến thi công và hoàn thiện, mọi quy trình đều...
Chất Lượng và Sáng Tạo: Kiến Trúc...