‘壹’ VC++编写连接FTP服务器程序,编译的时候报错
m_pInetsession=new CInternetsession(AfxGetAppName(),1,PRE_CONFIG_INTERNET_ACCESS);
这一行 中的 CInternetSession中的session应该是大写吧
‘贰’ 如何用VC开发SFTP的客户端
一、路由器下的FTP服务端:
路由器下的FTP服务端,需要解决一个“安全验证”问题,IE客户端会核对服务端的IP
地址,因为服务端是内外两个IP,而使IE客户端安全验证失败,但专业FTP客户端CuteFTP9、LeapFTP3
可以不核对IP验证,而使访问成功,但用户总是喜欢IE做客户端,为此需要找一个解决“安全验证”
的FTP服务端,FileZilla FTP Server就是最实用小巧的FTP理想服务端,只有1M多一点,非常小巧。
二、路由器下的FTP服务端要被外网IE访问的因素:
1. FTP服务端WINDOWS电脑要关闭自带的防火墙或设成FTP服务程序为“例外”;
2. 路由器下的电脑服务器要设成路由器的DMZ主机,这样服务端端口就.开.放在外网,
才能被外网所访问,所以,服务端电脑要设成静态IP如 192.168.1.10,并把路由器的
DMZ主机设为此IP,设DMZ后就不需要再设.端.口.映.射.了;
3. FileZilla FTP SERVER要设成被动方式PASV,并要指定一个外网IP,以解决NAT的安全验
证问题,否则,客户端不能被WINDOWS的IE所访问,但能被CuteFTP访问;
4. 外网的端.口不能被运营商所封或者不能是共享外网IP地址的NAT代理,端口会因NAT改变;
三、FileZilla FTP Server需要的设定:
1. 需要设定为 Passive被动模式:端口范围可为设为 10000-10050
2. 指定的IP要设为外IP:以解决“安全验证”问题
这个外IP就是将要被访问的FTP://外IP
3. 用户增加 anonymous,密码不设,这是匿名方式;
4. 共享文件夹设成你的一个被访问目录;
5. 其它21号服务端口等缺省参数不需改动。
四、程序说明:
一、FileZilla server.exe 这是后台服务程序,运行后启动服务就可;
二、FileZilaa Server Interface.exe 这是界面管理程序,让管理员设定参数的。
‘叁’ 怎样用VC在vs2008环境下编写一个可以访问ftp服务器下的目录文件的程序,求:详细步骤
对不起,我对FTP不怎么理解。
我可以告诉你方法:
1)、仔细研究下FTP协议,FTP是应用层的协议,可以直接建立套接字应用程序,直接将需要访问的目录信息发给服务器。
2)、建立套接字时,服务端口一般是21,IP即是服务器的IP。
3)、遵循FTP通信协议和服务器进行通讯,这样别说是访问FTP下的目录,就是直接上传下载文件都是可以的。
‘肆’ 怎么用VC++编写一个检查网络连接的程序,以及是否能连接外部ftp服务器
gethostname()函数可以 满足你1 的要求,
2,就复杂了,如果你在程序中指定了IP 比较好办 GetSocketName()就可以检测出来,不成功就返回0.0.0.0 。
如果你是想随便就想知道能不能连一个随意的FTP那可麻烦了。不能做一个扫描器吧。
‘伍’ 在VC程序中如何用FTP与服务器连接并从服务器上下载文件
我要回复《在VC程序中如何用FTP与服务器连接?并从服务器上下载文件?》
能够在如此精彩的帖子后面留下自己的网名是多么骄傲的一件事啊!
‘陆’ 求用vc6.0编写的ftp服务器和客户端 通过客户端链接服务器 可以用ls命令查看文件属性和get命令实现文件传输
才这么点分儿,切~鬼才给你写啊!!!!
‘柒’ C语言实现从FTP下载、上传文件
FTP 是File Transfer Protocol(文件传输协议)的英文简称,而中文简称为“文传协议”。
1.C语言可以使用CStdioFile函数打开本地文件。使用类CInternetSession 创建并初始化一个Internet打开FTP服务器文件。
CStdioFile继承自CFile,一个CStdioFile 对象代表一个用运行时函数fopen 打开的C 运行时流式文件。
流式文件是被缓冲的,而且可以以文本方式(缺省)或二进制方式打开。文本方式提供对硬回车—换行符对的特殊处理。当你将一个换行符(0x0A)写入一个文本方式的CStdioFile 对象时,字节对(0x0D,0x0A)被发送给该文件。当你读一个文件时,字节对(0x0D,0x0A)被翻译为一个字节(0x0A)。
CStdioFile 不支持Duplicate,LockRange,和UnlockRange 这几个CFile 函数。如果在CStdioFile 中调用了这几个函数,将会出现CNoSupported 异常。
使用类CInternetSession 创建并初始化一个或多个同时的Internet 会话。如果需要,还可描述与代理服务器的连接。
如果Internet连接必须在应用过程中保持着,可创建一个类CWinApp的CInternetSession成员。一旦已建立起Internet 会话,就可调用OpenURL。CInternetSession会通过调用全局函数AfxParseURL来为分析映射URL。无论协议类型如何,CInternetSession 解释URL并管理它。它可处理由URL资源“file://”标志的本地文件的请求。如果传给它的名字是本地文件,OpenURL 将返回一个指向CStdioFile对象的指针。
如果使用OpenURL在Internet服务器上打开一个URL,你可从此处读取信息。如果要执行定位在服务器上的指定的服务(例如,HTTP,FTP或Gopher)行为,必须与此服务器建立适当的连接。
‘捌’ 登陆FTP服务器后怎么显示服务器端的操作界面 vc
我也没经验,可以讨论一下。
登陆流程:
1、服务器开启。
2、客户端登陆,向服务器发送登陆信息,服务器验证登陆信息,存储用户信息,返还当前用户列表,断开连接。
验证用户是否存在流程:
1、客户端每隔一定时间,向服务器端发送“alive”报文,服务器端认为用户仍然登陆,并且返还当前可用用户列表。
2、如果客户端超过一定时间不向服务器发送"alive"报文,则服务器端认为用户已经掉线,从可用用户列表中删除该用户。
发送消息流程:
客户端A发送报文给服务器端,服务器端转发报文给客户端B,如果客户端B成功接收,则返回报文给服务器端,服务器端将客户端B成功接收的信息返回给客户端A。
你说的每隔用户连接都开一个线程是什么意思呢?
按照我刚刚说的,服务器端肯定是只存在一个侦听线程,然后接收到报文以后,根据报文类型,创建不同的工作线程去进行处理。瀚斯宝丽显示器质量顶呱呱
戴尔显示器质量好但是价格硬
三星显示器属于中高档
华硕显示器很少见
联想的显示器不拆开卖
瀚视奇显示器是瀚斯宝丽的一个下属品牌
清华同方是大众品牌
飞利浦显示器质量很好
‘玖’ 多线程FTP程序用VC/C++如何设计
这是codeproject的关于ftp的实现,你可以去down源代码
Introction
StuffFTP is a free for life FTP client. This FTP client will allow you to connect to FTP servers and upload and download files.
Motivation
Why did I create and continue to support StuffFTP? First it is a learning experience, and since I just got laid off from my company, I decided to use some of the tools they have provided, its legal as I technically bought them and they do not have other programmers following in my footstep nor do they plan on hiring any, to create something for the community. I also used another FTP program that was freeware for a while and then became pay to use software with little to no notice. That irked me and a friend suggested I create my own FTP client. So I am.
Progress
This is currently a work in progress and I would be the first to say there is a lot of work to do. Since I am laid off, I have lots of time on my hands. And this is an excellent chance for me to learn some of the concepts of C++ that I wanted to, but never had the chance while I was working. I was hoping to get a job in San Jose, CA, but decided to hold off and live on saving for a while.
Guarantee
I will support this program as best as I can. I have already setup a website and forum for it, here. I use the forum because I have trouble responding to email especially when I get a whole bunch of SPAM everyday. There is no adware or spyware in the program, and I guarantee that it will be free for the life of the program.
Some people have already asked why I don't open source the project. The main reason is I do not know if I can. StuffFTP uses some proprietary third party libraries. I do not know if I can post the source code or header files to those libraries. So everyone will have to wait until I can get rid of those libraries or hear back from the companies concerning my question about releasing header and associated help files.
Tools
* MS Windows XP Professional
* MS Visual Studio .NET C++/MFC
* Clickteam Install Maker
* Clickteam Patch Maker
* Betaone.net forum members
* CXListCtrl by Hans Dietrich
3rd Party Libraries
The application uses Catalyst Socket Tools Library Edition and Professional UI GUI library. So far the support has been fair with Prof-UI and outstanding with Catalyst. The Catalyst tool is for the actual FTP connection and, as the name suggests, Prof-UI is being used for the GUI.
Updates
You can find the latest updates here and you can also find my latest ramblings, blogs, and support here. This is where you can find out all the latest versions and information.
How to contribute
Money! Just kidding you can contribute by downloading, using, and giving feedback on the program. That way I can determine which path to take with the application and which features to prioritize or not. Graphics is also where I need lots of help. I am left brained and can not draw a good stick figure to save my life. If you can help with graphics or anything else, please let me know. Also talk to me, I am bored. I have no job at the moment so I can use the company.
Features
* Able to upload/download from server/computer
* Connect to FTP sites using login
* Connect using other ports besides 21
* Delete, rename, and CHMOD a file
History
* 12/10/2003 - Version 0.11a
* 12/07/2003 - Version 0.10a
‘拾’ vc 模拟ftp 有服务器端和客户端
...........
建议你去专业一点的网站.....