请问大佬们我这个代码怎么修改?
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace 播放器接口
{ public partial class IUsb { public IUsb() { InitializeComponent(); } private void InitializeComponent() { throw new NotImplementedException(); } IPlayer ip; IPhone m; MobilePhone a; private void button1_Click(object sender, EventArgs e) { m = new IUsb(); ip = (IPlayer)m; } private void button2_Click(object sender, EventArgs e) { a = new MobilePhone(); ip = (IPlayer)a; } //上一首 private void button3_Click(object sender, EventArgs e) { if (a is IPlayer || m is IPlayer) { label1.Text = "\n" + ip.Pre(); } else { MessageBox.Show("请选择IPhone或MobilePhone"); } } //停止 private void button4_Click(object sender, EventArgs e) { if (a is IPlayer || m is IPlayer) { label1.Text = "\n" + ip.Stop(); } else { MessageBox.Show("请选择IPhone或MobilePhone"); } } //播放 private void button5_Click(object sender, EventArgs e) { if (a is IPlayer || m is IPlayer) { label1.Text = "\n" + ip.Play(); } else { MessageBox.Show("请选择IPhone或MobilePhone"); } } //暂停 private void button6_Click(object sender, EventArgs e) { if (a is IPlayer || m is IPlayer) { label1.Text = "\n" + ip.Pause(); } else { MessageBox.Show("请选择IPhone或MobilePhone"); } } //下一首 private void button7_Click(object sender, EventArgs e) { if (a is IPlayer || m is IPlayer) { label1.Text = "\n" + ip.Next(); } else { MessageBox.Show("请选择IPhone或MobilePhone"); } } private void IUsb_Load(object sender, EventArgs e) { IUsb.label1.Text = ""; } public string Play() { return ip.Play(); } public string Stop() { return ip.Stop(); } public string Pause() { return ip.Pause(); } public string Pre() { return ip.Pre(); } public string Next() { return ip.Next(); } public class label1 { } public class MessageBox { internal static void Show(string v) { throw new NotImplementedException(); } } public interface IPhone { } } interface IPlayer { string Pre(); string Play(); string Stop(); string Pause(); string Next(); } public class IPhone : IPlayer { public string Play() { return "正在播放IPhone歌曲!"; } public string Stop() { return "停止播放IPhone歌曲"; } public string Pause() { return "暂停播放IPhone歌曲"; } public string Pre() { return "播放上一首IPhone歌曲"; } public string Next() { return "播放下一首IPhone歌曲"; } } public class MobilePhone : IPlayer { public string Play() { return "正在播放MobilePhone视频!"; } public string Stop() { return "停止播放MobilePhone视频"; } public string Pause() { return "暂停播放MobilePhone视频"; } public string Pre() { return "播放上一首MobilePhone视频"; } public string Next() { return "播放下一首MobilePhone视频"; } }
}