kadirselen
Mesaj Sayısı : 550 Kayıt tarihi : 15/08/10 Yaş : 34 Nerden : Denizli Cinsiyet :
| Konu: c# ile cdrom acma kapama Cuma Ağus. 20, 2010 11:48 am | |
| - Kod:
-
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 Cd_Rom_Prog { public partial class Form1 : Form { public Form1() { InitializeComponent(); }
[DllImport("winmm.dll", EntryPoint = "mciSendStringA", CharSet = CharSet.Ansi)] protected static extern int mciSendString(string lpstrCommand, StringBuilder lpstrReturnString, int uReturnLength, IntPtr hwndCallback);
private void Form1_Load(object sender, EventArgs e) {
}
private void button1_Click(object sender, EventArgs e) { int ret = mciSendString("set cdaudio door open", null, 0, IntPtr.Zero); }
private void button2_Click(object sender, EventArgs e) { int ret = mciSendString("set cdaudio door closed", null, 0, IntPtr.Zero); } } }
| KADİR SELEN-HAKAN ŞEN |
| |
|