/// <summary>
/// 配置IP和端口
/// </summary>
void ConfigIP()
{
StreamReader sr = new StreamReader(Application.streamingAssetsPath + "/IPConfig.txt");
string[] strs = sr.ReadToEnd().Split(';');
localIP = strs[0];
localport = int.Parse(strs[1]);
DPIP = strs[2];
DPport = int.Parse(strs[3]);
LIP = strs[4];
Lport = int.Parse(strs[5]);
RIP = strs[6];
Rport = int.Parse(strs[7]);
}
本文介绍了如何在C#中通过`StreamReader`读取`IPConfig.txt`文件中的IP和端口配置信息,用于设置本地和远程的IP地址和端口号。
13万+

被折叠的 条评论
为什么被折叠?



