使用Dev在Win 7中进行C / C ++套接字编程 [英] C/C++ Socket Programming in Win 7 using Dev

查看:93
本文介绍了使用Dev在Win 7中进行C / C ++套接字编程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的朋友们,

我必须在最短的时间内学习Socket编程,而我是C / C ++编程的初学者。

1-哪个使用Windows 7和Dev-C ++来学习这门课程是最好的?



2-看来我必须添加一些库,我不知道我在哪里下载正确的一个以及如何将它们添加到我的Windows 7和/或Dev-C ++中?



3-我需要一个非常简单和完整的可行示例让我们我阅读了http网页,并使用套接字编程将内容保存在文本文件中。 (我无法在互联网上运行任何示例,因为我无法调试它们!)



4-我正在下面的客户端示例但它有构建错误,有人可以帮助我吗?



非常感谢您的快速回复。

Dear Friends,
I have to learn the Socket programming in a minimum time period possible while I am a beginner in the C/C++ programing.
1- Which source is the best for learning this subject with windows 7 and Dev-C++?

2- It seems i have to add some libraries and I do not know where I have to download the right one and how to add them to my windows 7 and/or Dev-C++?

3- I need a very simple and complete workable example to let me read the http webpage and save the content in a text file using socket programing. (I could not run any example in the internet as I am not able to debug them!!!)

4- I am working on below client example but it has build error, may anyone help me?

Many Thanks in advanced for your quick reply.

推荐答案

Google搜索找到很多建议 [ ^ ]。
A Google search finds lots of suggestions[^].


#pragma comment(lib ,Ws2_32.lib)



你应该把它包括在你的开始计划中。

抱歉我的英语很差。
#pragma comment(lib,"Ws2_32.lib")

you should include it in your begining program.
sorry for my poor english .


我在网站上有一个项目,远程控制PC [< a href =http://www.codeproject.com/Articles/565/Remote-Control-PCstarget =_ blanktitle =New Window> ^ ],它有一个套接字类,基于在发布到Windows消息泵的事件上。这似乎是掌握套接字的最简单方法。这些类是TCPSocket.h / TCPSocket.cpp。只需一点点工作,您就可以提取并构建一对作为客户端/服务器的DOS程序
I have a project on the site, Remote Control PCs[^], which has a socket class, based on events posted to the windows message pump. It seems like the easiest way to grasp sockets. The classes are TCPSocket.h/TCPSocket.cpp. With just a tiny bit of work you could extract and build a pair of DOS programs that work as a client/server


这篇关于使用Dev在Win 7中进行C / C ++套接字编程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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