文章目录
一、实验准备
1.环境配置
VS2019,一个游戏包(也可以是一个空的控件表),游戏包(笑熬江糊)
提取码:zyd8
2.效果图
二、工具的添加
1.连接服务器
1.1).源码
public partial class Form1 : Form
{
private const string V = @“E:\QQMusic Download\许冠杰 - 沧海一声笑.mp3”;
private NetworkStream stream;
private TcpClient tcpClient = new TcpClient();
private object axWindowsMediaPlayer1;
public Form1()
{
InitializeComponent();
try
{
TcpClient tcp = new TcpClient();
tcp.Connect("10.1.230.41", 3900);
listBox1.Items.Add("Connect Successfully!");
stream = tcp.GetStream();
byte[] data = new byte[1024];
if (stream.CanRead)
{
int len = stream.Read(data, 0, data.Length);
string msg = Encoding.UTF8.GetString(data, 0, data.Length);
string str = "\r\n";
char[] str1 = str.ToCharArray();
string[] msg1