现在,拜托,我知道如何在我右键单击listView时弹出一个contextMenu,我想要的是当我右键单击一个项目时弹出它.我正在尝试制作聊天服务器和客户端,现在......现在我想在我右键单击连接的客户端项目时查看客户端信息.现在我该怎么做?
谢谢!
所以我一直在尝试创建一些代码,这些代码在while循环上发送数据,特别是通过UdpClient向服务器发送活动数据包.
static void doSend(string ip, int port)
{
while (isSending)
{
_sockMain = new UdpClient(ip, port);
// Code for datagram here, took it out
_sockMain.Send(arr_bData, arr_bData.Length);
}
}
Run Code Online (Sandbox Code Playgroud)
但是当我调用"停止"方法时,它会陷入一个恒定的循环并且不会出现.如何将while循环放入线程?所以我可以在停止时中止线程,取消循环?
在过去的30分钟里,我一直在尝试将const char转换为char.这就是我所拥有的.
string atr;
getline(cin,atr); // Start off with a string because getline takes nothing else.
const char *buffA = atr.c_str(); // Create a const char of the string converted to a const char.
char *buff = ""; // Create a new char to hold the converted result.
strcat(buff,buffA); // Do the conversion.
parseargs(buff); // Pass the data on.
Run Code Online (Sandbox Code Playgroud)
但是,我得到了一个未处理的异常.我不知道为什么.我只是在控制台中键入'try'作为我唯一的参数.
是否可以将目录中的所有文件和文件夹打包并打包到单个包文件中,以便我可以通过网络传输此包,然后从包中解压缩所有文件和文件夹?
我尝试用C#查看ZIP文件,因为我的目标是相同的想法,但实际的方法只有.NET 3.5(我相信),我也希望程序非常轻量级,这意味着我不要如果我想解压缩/解压缩单个文件,我希望外围模块位于必须使用的位置.
我怎么能做到这一点?