Недавно я разработал музыкальный проигрыватель в С# WindowsFormsApplications.
Все идет хорошо только при выборе программы по умолчанию, она может открыть один музыкальный файл отлично, но при выборе 5 музыкальных файлов. 5 музыкальный проигрыватель открыт.
Как исправить это, чтобы открыть несколько файлов, когда вы устанавливаете его по умолчанию, как список воспроизведения в С#? И я не пробовал ничего или кода для этого. пожалуйста помоги!
это моя программа.cs
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main(string[] args)
{
//with args(user open file with the program)
if (args != null && args.Length > 0)
{
string fileName = args[0];
//Check file exists
if (File.Exists(fileName))
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Form1 MainFrom = new Form1();
MainFrom.OpenFile(fileName);
Application.Run(MainFrom);
}
//The file does not exist
else
{
MessageBox.Show("The file does not exist!", "BMPlayer Error!", MessageBoxButtons.OK, MessageBoxIcon.Error);
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
}
}
//without args
else
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
}
}
}
И это Form1.cs для открытия файла
public void OpenFile(string filePath)
{
string file1 = File.ReadAllText(filePath);
axWindowsMediaPlayer1.URL = filePath;
}
Main
вашего приложения (вProgram.cs
) - person Nino   schedule 03.08.2017