如何将TCP数据包发送到IP:端口 [英] How to send tcp packet to IP:port

查看:130
本文介绍了如何将TCP数据包发送到IP:端口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何制作仅将tcp数据包发送到IP:port的简单C#程序.我从google搜索示例,但是如果尝试编译它们,则会收到错误:(

我只想以二进制模式将数据包发送到IP:port,我不想检查服务器是否启动,只需发送没有任何检查的数据包即可.

谢谢

How can I make simple C# program that just send tcp packet to IP:port. I searched for examples from google but if I try compile them I get errors :(

I want just send packet to IP:port in binary mode , I don't want check if server is up or not, just send packet with out any checks.

thanks

推荐答案

请参见http://msdn.microsoft.com/en-us/library/system.net.sockets.tcpclient.aspx (有一个

在所有错误检查都很重要的方案中,TCP/IP在必须检查错误列表中处于很高的位置.
See http://msdn.microsoft.com/en-us/library/system.net.sockets.tcpclient.aspx (there's a sample there).

By the way of all the scenarios where error checking is important, TCP/IP would be very high up on the must-check-for-errors list.


这篇关于如何将TCP数据包发送到IP:端口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆