本文介绍了使用telnet或ftp抓横幅广告[几乎完成]的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人知道如何使用c#代码对任何网站进行横幅广告抓取吗?

我尝试使用telnet命令在cmd.exe上进行尝试,并且能够在控制台本身上获取标语信息,但是由于需要虚拟回车才能获得结果.
我无法在网络浏览器上重定向结果.

任何替代方案或链接都将是合理的.

[edit]
使用此代码完成的操作:

Does anyone have an idea of how to perform banner grabbing for any website using c# code?

I tried on cmd.exe using telnet command and was able to grab the banner information on the console itself but since it requires dummy enter presses for the result.
I am not able to redirect the result on the web browser.

Any alternative or links will be appreciable.

[edit]
Done using this:

HttpWebResponse myHttpWebResponse = null;
                   try
                   {
                       myHttpWebResponse = (HttpWebResponse)myHttpWebRequest.GetResponse();
                   }
                   catch (WebException ex)
                   {
                       myHttpWebResponse = (HttpWebResponse)ex.Response;
                   }
                   txtDisplay.Text = "\n\n"+ myHttpWebResponse.Headers.ToString().Replace("\r\n","\r\n\n");



[/edit]
:)

谢谢
Anurag:rose:



[/edit]
:)

Thanks
Anurag :rose:

推荐答案


这篇关于使用telnet或ftp抓横幅广告[几乎完成]的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-23 10:55
查看更多