Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the spbsm domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /home/rjsrsxcg/public_html/wp-includes/functions.php on line 6121
C sharp ses player hazırlama – kodcafe.com

C sharp ses player hazırlama

Yakında bunu geliştireceğiz…


using System;

using System.Collections.Generic;

using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.IO;
using System.Windows.Forms;
using System.Runtime.InteropServices;

namespace MiniPlayer
{
public partial class Sesplayer : Form
{
[DllImport("winmm.dll")]

private static extern long mciSendString(string strCommand, StringBuilder strReturn, int iReturnLength, IntPtr hwndCallback);
public string Pcommand;

public bool isOpen;
public Sesplayer()
{
InitializeComponent();
}
public void Play(bool loop)
{

if (isOpen)
{

Pcommand = "play MediaFile";

if (loop)

Pcommand += " REPEAT";

mciSendString(Pcommand, null, 0, IntPtr.Zero);
}
}

private void Form2_Load(object sender, EventArgs e)
{

}

private void Dosya_ac_Click(object sender, EventArgs e)
{
openFileDialog1.Filter = "Media File(*.mpg,*.dat,*.avi,*.wmv,*.wav,*.mp3)|*.wav;*.mp3;*.mpg;*.dat;*.avi;*.wmv";
openFileDialog1.ShowDialog();
if (openFileDialog1.FileName != "")
textBox1.Text = openFileDialog1.FileName;
}

private void Cal_Click(object sender, EventArgs e)
{
Pcommand = "open \"" + textBox1.Text + "\" type mpegvideo alias MediaFile";

mciSendString(Pcommand, null, 0, IntPtr.Zero);

isOpen = true;
Play(true);
}

private void Durdur_Click(object sender, EventArgs e)
{
Pcommand = "close MediaFile";

mciSendString(Pcommand, null, 0, IntPtr.Zero);

isOpen = false;
}

private void cıkıs_Click(object sender, EventArgs e)
{
Application.Exit();
}
}
}