亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來(lái)到蟲(chóng)蟲(chóng)下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲(chóng)蟲(chóng)下載站

?? ch19.htm

?? Learning language of Visual C++6
?? HTM
?? 第 1 頁(yè) / 共 3 頁(yè)
字號(hào):
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>

<HEAD>
<SCRIPT LANGUAGE="JavaScript">

<!--

function popUp(pPage) {
 var fullURL = document.location;
 var textURL = fullURL.toString();
 var URLlen = textURL.length;
 var lenMinusPage = textURL.lastIndexOf("/");
 lenMinusPage += 1;
 var fullPath = textURL.substring(0,lenMinusPage);
 popUpWin = window.open('','popWin','resizable=yes,scrollbars=no,width=525,height=394');
 figDoc= popUpWin.document;
 zhtm= '<HTML><HEAD><TITLE>' + pPage + '</TITLE>';
 zhtm += '<link rel="stylesheet" href="/includes/stylesheets/ebooks.css"></head>';
 zhtm += '<BODY bgcolor="#FFFFFF">';
 zhtm += '<IMG SRC="' + fullPath + pPage + '">';
 zhtm += '<P><B>' + pPage + '</B>';
 zhtm += '</BODY></HTML>';
 window.popUpWin.document.write(zhtm);
 window.popUpWin.document.close();
 // Johnny Jackson 4/28/98
 }

//-->
                                                                
</SCRIPT>
<link rel="stylesheet" href="/includes/stylesheets/ebooks.css">

	
	<TITLE>Special Edition Using Visual C++ 6 -- Ch 19 -- Internet Programming with the WinInet Classes</TITLE>
</HEAD>

<BODY TEXT="#000000" BGCOLOR="#FFFFFF">

<CENTER>
<H1><IMG SRC="../button/que.gif" WIDTH="171" HEIGHT="66" ALIGN="BOTTOM" BORDER="0"><BR>
Special Edition Using Visual C++ 6</H1>
</CENTER>
<CENTER>
<P><A HREF="../ch18/ch18.htm"><IMG SRC="../button/previous.gif" WIDTH="128" HEIGHT="28"
ALIGN="BOTTOM" ALT="Previous chapter" BORDER="0"></A><A HREF="../ch20/ch20.htm"><IMG
SRC="../button/next.gif" WIDTH="128" HEIGHT="28" ALIGN="BOTTOM" ALT="Next chapter"
BORDER="0"></A><A HREF="../index.htm"><IMG SRC="../button/contents.gif" WIDTH="128"
HEIGHT="28" ALIGN="BOTTOM" ALT="Contents" BORDER="0"></A> 
<HR>

</CENTER>
<CENTER>
<H1>- 19 -</H1>
</CENTER>
<CENTER>
<H1>Internet Programming with the WinInet Classes</H1>
</CENTER>

<UL>
	<LI><A HREF="#Heading1">Designing the Internet Query Application</A>
	<LI><A HREF="#Heading2">Building the Query Dialog Box</A>
	<LI><A HREF="#Heading3">Querying HTTP Sites</A>
	<LI><A HREF="#Heading4">Querying FTP Sites</A>
	<LI><A HREF="#Heading5">Querying Gopher Sites</A>
	<LI><A HREF="#Heading6">Using Gopher to Send a Finger Query</A>
	<LI><A HREF="#Heading7">Using Gopher to Send a Whois Query</A>
	<LI><A HREF="#Heading8">Future Work</A>
</UL>

<P>
<HR SIZE="4">

<CENTER>
<H1></H1>
</CENTER>
<H2><A NAME="Heading1"></A>Designing the Internet Query Application</H2>
<P>Chapter 18, &quot;Sockets, MAPI, and the Internet,&quot; introduces the WinInet
classes that you can use to build Internet client applications at a fairly high level.
This chapter develops an Internet application that demonstrates a number of these
classes. The application also serves a useful function: You can use it to learn more
about the Internet presence of a company or organization. You don't need to learn
about sockets or handle the details of Internet protocols to do this.</P>
<P>Imagine that you have someone's email address (<B>kate@gregcons.com, </B>for example)
and you'd like to know more about the domain (<B>gregcons.com </B>in this example).
Perhaps you have a great idea for a domain name and want to know whether it's already
taken. This application, Query, will try connecting to <B>gregcons.com</B> (or <B>greatidea.org</B>,
or any other domain name that you specify) in a variety of ways and will report the
results of those attempts to the user.</P>
<P>This application will have a simple user interface. The only piece of information
that the user needs to supply is the domain name to be queried, and there is no need
to keep this information in a document. You might want a menu item called Query that
brings up a dialog box in which to specify the site name, but a better approach is
to use a dialog-based application and incorporate a Query button into the dialog
box.</P>
<P>A dialog-based application, as discussed in the section &quot;A Dialog-Based Application&quot;
of Chapter 1, &quot;Building Your First Application,&quot; has no document and no
menu. The application displays a dialog box at all times; closing the dialog box
closes the application. You build the dialog box for this application like any other,
with Developer Studio.</P>
<P>To build this application's shell, choose File, New from within Developer Studio
and then click the Project tab. Highlight MFC AppWizard(exe), name the application
<B>Query</B>, and in Step 1 choose Dialog Based, as shown in Figure 19.1. Click Next
to move to Step 2 of AppWizard.</P>
<P><A HREF="javascript:popUp('19uvc01.gif')"><B>FIG. 19.1</B></A><B> </B><I>Choose
a dialog-based application for Query.</I></P>
<P>In Step 2 of AppWizard, request an About box, no context-sensitive Help, 3D controls,
no automation or ActiveX control support, and no sockets support. (This application
won't be calling socket functions directly.) Give the application a sensible title
for the dialog box. The AppWizard choices are summarized, as shown in Figure 19.2.
Click Next to move to Step 3 of AppWizard.</P>
<P><A HREF="javascript:popUp('19uvc02.gif')"><B>FIG. 19.2</B></A><B> </B><I>This
application doesn't need Help, automation, ActiveX controls, or sockets.</I></P>
<P>The rest of the AppWizard process will be familiar by now: You want comments,
you want to link to the MFC libraries as a shared DLL, and you don't need to change
any of the classnames suggested by AppWizard. When the AppWizard process is completed,
you're ready to build the heart of the Query application.</P>
<P>
<H2><A NAME="Heading2"></A>Building the Query Dialog Box</H2>
<P>AppWizard produces an empty dialog box for you to start with, as shown in Figure
19.3. To edit this dialog box, switch to the resource view, expand the Query Resources,
expand the Dialogs section, and double-click the IDD_QUERY_DIALOG resource. The following
steps will transform this dialog box into the interface for the Query application.</P>
<P><A HREF="javascript:popUp('19uvc03.gif')"><B>FIG. 19.3</B></A><B> </B><I>AppWizard
generates an empty dialog box for you.</I></P>
<P>


<BLOCKQUOTE>
	<P>
<HR>
<strong>TIP:</strong> If working with dialog boxes is still new to you, be sure to read
	Chapter 2, &quot;Dialogs and Controls.&quot; 
<HR>


</BLOCKQUOTE>


<DL>
	<DT></DT>
	<DD><B>1. </B>Change the caption on the OK button to <B>Query</B>.
	<P>
	<DT></DT>
	<DD><B>2. </B>Change the caption on the Cancel button to <B>Close</B>.
	<P>
	<DT></DT>
	<DD><B>3. </B>Delete the TODO static text.
	<P>
	<DT></DT>
	<DD><B>4. </B>Grab a sizing handle on the right edge of the dialog box and stretch
	it so that the dialog box is 300 pixels wide or more. (The size of the currently
	selected item is in the lower-right corner of the screen.)
	<P>
	<DT></DT>
	<DD><B>5. </B>At the top of the dialog box, add an edit box with the resource ID
	IDC_HOST. Stretch the edit box as wide as possible.
	<P>
	<DT></DT>
	<DD><B>6. </B>Add a static label next to the edit box. Set the text to Site name.
	<P>
	<DT></DT>
	<DD><B>7. </B>Grab a sizing handle along the bottom of the dialog box and stretch
	it so that the dialog box is 150 pixels high, or more.
	<P>
	<DT></DT>
	<DD><B>8. </B>Add another edit box and resize it to fill as much of the bottom part
	of the dialog box as possible.
	<P>
	<DT></DT>
	<DD><B>9. </B>Give this edit box the resource ID IDC_OUT.
	<P>
	<DT></DT>
	<DD><B>10. </B>Click the Styles tab on the Properties box and select the Multiline,
	Horizontal Scroll, Vertical Scroll, Border, and Read-Only check boxes. Make sure
	all the other check boxes are deselected.
	<P>
</DL>

<P>The finished dialog box and the Style properties of the large edit box will resemble
Figure 19.4.</P>
<P><A HREF="javascript:popUp('19uvc04.gif')"><B>FIG. 19.4</B></A><B> </B><I>Build
the Query user interface as a single dialog box.</I></P>
<P>When the user clicks the Query button, this application should somehow query the
site. The last step in the building of the interface is to connect the Query button
to code with ClassWizard. Follow these steps to make that connection:</P>

<DL>
	<DT></DT>
	<DD><B>1. </B>Choose View, Class Wizard to bring up ClassWizard.
	<P>
	<DT></DT>
	<DD><B>2. </B>There are three possible classes that could catch the command generated
	by the button click, but CQueryDlg is the logical choice because the host name will
	be known by that class. Make sure that CQueryDlg is the class selected in the Class
	Name drop-down list box.
	<P>
	<DT></DT>
	<DD><B>3.</B> Highlight ID_OK (you did not change the resource ID of the OK button
	when you changed the caption) in the left list box and BN_CLICKED in the right list
	box.
	<P>
	<DT></DT>
	<DD><B>4. </B>Click Add Function to add a function that will be called when the Query
	button is clicked.
	<P>
	<DT></DT>
	<DD><B>5. </B>ClassWizard suggests the name OnOK; change it to <B>OnQuery</B>, as
	shown in Figure 19.5, and then click OK.
	<P>
</DL>

<P><A HREF="javascript:popUp('19uvc05.gif')"><B>FIG. 19.5</B></A><B> </B><I>Add a
function to handle a click on the Query button, still with the ID IDOK.</I></P>
<P>

<DL>
	<DT><I></I></DT>
	<DD><B>6. </B>Click the Member Variables tab to prepare to connect the edit controls
	on the dialog box to member variables of the dialog class.
	<P>
	<DT></DT>
	<DD><B>7. </B>Highlight IDC_HOST and click Add Variable. As shown in Figure 19.6,
	you'll connect this control to a CString member variable of the dialog class m_host.
	<P>
	<DT></DT>
	<DD><B>8. </B>Connect IDC_OUT to m_out, also a CString.
	<P>
</DL>

<P>Click OK to close ClassWizard. Now all that remains is to write CQueryDlg::OnQuery(),
which will use the value in m_host to produce lines of output for m_out.</P>
<P><A HREF="javascript:popUp('19uvc06.gif')"><B>FIG. 19.6</B></A><B> </B><I>Connect
IDC_HOST to CQueryDlg::m_host.</I></P>
<H2><A NAME="Heading3"></A>Querying HTTP Sites</H2>
<P>The first kind of connection to try when investigating a domain's Internet presence
is HTTP because so many sites have Web pages. The simplest way to make a connection
using HTTP is to use the WinInet class CInternetSession and call its OpenURL() function.
This will return a file, and you can display the first few lines of the file in m_out.
First, add this line at the beginning of QueryDlg.cpp, after the include of stdafx.h:</P>
<P>
<PRE>#include &quot;afxinet.h&quot;
</PRE>
<P>This gives your code access to the WinInet classes. Because this application will
try a number of URLs, add a function called TryURL() to CQueryDlg. It takes a CString
parameter called URL and returns void. Right-click CQueryDlg in the ClassView and
choose Add Member Function to add TryURL() as a protected member function. The new
function, TryURL(), will be called from CQueryDlg::OnQuery(), as shown in Listing
19.1. Edit OnQuery() to add this code.</P>
<P>
<H4>Listing 19.1&#160;&#160;QueryDlg.cpp--CQueryDlg::OnQuery()</H4>
<PRE>void CQueryDlg::OnQuery() 
{
     const CString http = &quot;http://&quot;;
     
     UpdateData(TRUE);
     m_out = &quot;&quot;;
     UpdateData(FALSE);
     TryURL(http + m_host);
     TryURL(http + &quot;www.&quot; + m_host);
</PRE>
<PRE>}
</PRE>
<P>The call to UpdateData(TRUE) fills m_host with the value that the user typed.
The call to UpdateData(FALSE) fills the IDC_OUT read-only edit box with the newly
cleared m_out. Then come two calls to TryURL(). If, for example, the user typed<B>
microsoft.com</B>, the first call would try <B>http://microsoft.com</B> and the second
would try <B>http://www.microsoft.com</B>. TryURL() is shown in Listing 19.2.</P>
<P>
<H4>Listing 19.2&#160;&#160;QueryDlg.cpp--CQueryDlg::TryURL()</H4>
<PRE>void CQueryDlg::TryURL(CString URL)
{
     CInternetSession session;
     m_out += &quot;Trying &quot; + URL + &quot;\r\n&quot;;
     UpdateData(FALSE);
     CInternetFile* file = NULL;
     try
     {
          //We know for sure this is an Internet file,
          //so the cast is safe
          file = (CInternetFile*) session.OpenURL(URL);
     }
     catch (CInternetException* pEx)
     {
          //if anything went wrong, just set file to NULL
          file = NULL;
          pEx-&gt;Delete();
     }
     if (file)
     {
          m_out += &quot;Connection established. \r\n&quot;;
          CString line;
          for (int i=0; i &lt; 20 &amp;&amp; file-&gt;ReadString(line); i++)
          {
               m_out += line + &quot;\r\n&quot;;
          }
          file-&gt;Close();
          delete file;
     }
     else
     {
          m_out += &quot;No server found there. \r\n&quot;;
     }
     m_out += &quot;------------------------\r\n&quot;;
     UpdateData(FALSE);
</PRE>
<PRE>}
</PRE>
<P>The remainder of this section presents this code again, a few lines at a time.
First, establish an Internet session by constructing an instance of CInternetSession.
There are a number of parameters to this constructor, but they all have default values
that will be fine for this application. The parameters follow:</P>

<UL>
	<LI>LPCTSTR pstrAgent&#160;&#160;The name of your application. If NULL, it's filled
	in for you, using the name that you gave to AppWizard.
	<P>

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩精品亚洲一区| 韩国v欧美v亚洲v日本v| 亚洲精品一区二区精华| 精品卡一卡二卡三卡四在线| 成人免费毛片嘿嘿连载视频| 天天色综合天天| 亚洲柠檬福利资源导航| 久久久99精品久久| 欧美色综合久久| 99视频一区二区三区| 国内精品伊人久久久久av影院| 亚洲精品欧美激情| 国产精品午夜电影| 日韩免费一区二区三区在线播放| 91久久精品国产91性色tv| 丰满少妇久久久久久久| 久久99精品网久久| 日韩在线一区二区三区| 一区二区三区在线观看国产 | 在线日韩av片| 成人性色生活片| 国产一区美女在线| 免费人成在线不卡| 日韩中文字幕区一区有砖一区 | 26uuu国产一区二区三区| 欧美电影在线免费观看| 国产精品久久久久久久久图文区| 欧美草草影院在线视频| 欧美一级黄色录像| 欧美一区2区视频在线观看| 欧美色图在线观看| 欧美调教femdomvk| 色狠狠综合天天综合综合| av福利精品导航| 懂色一区二区三区免费观看| 精品一区二区三区香蕉蜜桃| 日本不卡的三区四区五区| 香蕉av福利精品导航| 亚洲h精品动漫在线观看| 亚洲国产精品一区二区久久恐怖片| 亚洲美女电影在线| 亚洲最新视频在线观看| 亚洲一区二区三区自拍| 午夜亚洲国产au精品一区二区| 五月激情六月综合| 日韩成人精品视频| 狠狠色综合播放一区二区| 国产一区二区三区在线观看免费| 国产精品自在在线| a级精品国产片在线观看| 99在线视频精品| 91精品办公室少妇高潮对白| 欧美自拍丝袜亚洲| 717成人午夜免费福利电影| 日韩欧美一级二级三级久久久| 精品成人免费观看| 国产精品毛片无遮挡高清| 日韩理论电影院| 天堂一区二区在线| 激情五月激情综合网| 成人视屏免费看| 91久久精品一区二区三| 欧美一区二区网站| 欧美极品少妇xxxxⅹ高跟鞋 | 国产精品久久久久一区二区三区共| 亚洲国产精品二十页| 亚洲永久免费av| 美女一区二区在线观看| 国产成人精品网址| 欧美性极品少妇| 精品国产乱码久久久久久老虎| 中文字幕av一区二区三区高| 亚洲精品v日韩精品| 日韩黄色小视频| 国产大片一区二区| 欧美日韩视频在线观看一区二区三区| 日韩午夜中文字幕| 亚洲人午夜精品天堂一二香蕉| 亚洲国产成人精品视频| 亚洲欧美日韩国产综合| 日韩国产欧美在线观看| av中文字幕不卡| 91麻豆精品国产自产在线| 欧美国产日产图区| 成人免费毛片高清视频| 国产成a人无v码亚洲福利| 精品影院一区二区久久久| 精久久久久久久久久久| 99久久精品国产导航| 日韩欧美一区二区不卡| 亚洲人成网站影音先锋播放| 蜜桃久久av一区| 色婷婷av一区| 国产欧美综合在线| 欧美aa在线视频| 91小宝寻花一区二区三区| 久久夜色精品国产噜噜av| 亚洲国产精品麻豆| 处破女av一区二区| 精品日韩av一区二区| 亚洲不卡在线观看| 91免费视频网| 亚洲国产成人私人影院tom| 日韩 欧美一区二区三区| 在线观看国产日韩| 中文字幕乱码亚洲精品一区| 日本不卡不码高清免费观看| 日本久久精品电影| 中文字幕亚洲成人| 韩国一区二区三区| 欧美一区二区三区精品| 亚洲午夜av在线| 91麻豆精品秘密| 中文字幕在线一区免费| 国产乱人伦偷精品视频免下载| 欧美一卡二卡在线观看| 亚洲mv在线观看| 欧美日韩在线播| 一区二区在线看| 97精品久久久午夜一区二区三区 | 欧美三级日韩三级国产三级| 国产精品国产三级国产aⅴ原创| 乱一区二区av| 日韩欧美高清在线| 美女视频黄免费的久久| 欧美精品v日韩精品v韩国精品v| 亚洲欧美日韩国产综合| 色婷婷激情一区二区三区| 中文字幕一区二区不卡| 成人午夜在线免费| 国产精品毛片高清在线完整版| 国产成人自拍网| 中文乱码免费一区二区| 成人三级在线视频| 中文字幕在线免费不卡| av亚洲精华国产精华| 亚洲日本韩国一区| 在线观看不卡视频| 亚洲二区视频在线| 欧美一区二区三区不卡| 狠狠色丁香久久婷婷综合_中| 精品美女一区二区| 国产精品一区专区| 国产精品私人影院| 色综合婷婷久久| 亚洲高清免费一级二级三级| 5566中文字幕一区二区电影| 免费精品99久久国产综合精品| 精品国产污污免费网站入口| 国产一区二区免费视频| 国产亚洲一区字幕| 91捆绑美女网站| 性欧美疯狂xxxxbbbb| 日韩一区二区精品在线观看| 欧美日韩视频不卡| 国内精品国产三级国产a久久| 久久久国产精品不卡| av一本久道久久综合久久鬼色| 亚洲欧美偷拍三级| 在线播放中文一区| 精一区二区三区| 国产精品三级视频| 欧美主播一区二区三区| 九一久久久久久| 国产欧美视频在线观看| 色综合色综合色综合色综合色综合 | 久久精品亚洲国产奇米99| 国产成人aaa| 亚洲线精品一区二区三区八戒| 制服丝袜亚洲色图| 成人午夜视频网站| 亚洲成人www| 国产欧美日产一区| 欧美性猛交xxxxxxxx| 国产原创一区二区| 国产精品无遮挡| 91麻豆精品国产91久久久资源速度 | 国产乱人伦偷精品视频不卡| 亚洲乱码日产精品bd| 3d成人h动漫网站入口| 国产成人精品网址| 三级亚洲高清视频| 亚洲视频在线观看一区| 91精品国产综合久久国产大片| 精品综合久久久久久8888| 亚洲综合色视频| 国产女人aaa级久久久级| 欧美日韩精品综合在线| 国产成人啪免费观看软件| 首页国产丝袜综合| 综合激情成人伊人| 精品欧美黑人一区二区三区| 在线观看日韩一区| 丰满少妇久久久久久久| 日本成人在线不卡视频| 中文字幕在线不卡一区二区三区| 欧美一级日韩不卡播放免费| 97久久人人超碰| 丁香激情综合五月| 亚洲超碰精品一区二区|