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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? ch19.htm

?? Learning language of Visual C++6
?? HTM
?? 第 1 頁 / 共 3 頁
字號:
<!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>

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩视频免费观看高清完整版| 成人深夜福利app| 欧美一卡二卡三卡| 视频一区二区国产| 欧美一级日韩免费不卡| 久久成人免费网| 亚洲精品一区二区在线观看| 成人免费毛片嘿嘿连载视频| 日韩理论电影院| 777a∨成人精品桃花网| 国产在线不卡一区| 亚洲靠逼com| 欧美一级国产精品| 国产精品69久久久久水密桃| 亚洲欧美视频在线观看视频| 欧美日本免费一区二区三区| 裸体在线国模精品偷拍| 国产精品久久久久久户外露出 | 91视频91自| 视频在线观看一区| 国产香蕉久久精品综合网| 99精品视频在线观看| 五月婷婷欧美视频| 久久日韩精品一区二区五区| 色综合久久久久网| 国内外成人在线| 一区二区三区四区中文字幕| 欧美不卡在线视频| 精品国产一区二区亚洲人成毛片| 成人免费看视频| 青青草成人在线观看| 国产精品高潮呻吟| 欧美大片免费久久精品三p| voyeur盗摄精品| 强制捆绑调教一区二区| 中文字幕日韩精品一区| 日韩欧美一二三| 欧美亚洲国产bt| 国产成人a级片| 蜜臀久久99精品久久久久久9| 国产精品不卡视频| 精品电影一区二区| 欧美精品少妇一区二区三区| 91网址在线看| 懂色av中文一区二区三区| 视频一区视频二区在线观看| 亚洲视频一区二区免费在线观看| 精品99一区二区| 正在播放亚洲一区| 欧美午夜精品电影| 91丨porny丨首页| 国产福利精品导航| 韩国av一区二区三区| 日韩电影在线一区二区| 亚洲人吸女人奶水| 国产精品久久久久7777按摩 | 亚洲精品一区二区三区精华液| 91成人在线观看喷潮| 成人免费高清在线| 国产电影一区在线| 国产伦精品一区二区三区在线观看| 天天综合天天综合色| 亚洲高清视频中文字幕| 亚洲精品一卡二卡| 亚洲精品日韩综合观看成人91| 国产精品福利影院| 国产精品嫩草99a| 国产人伦精品一区二区| 久久亚洲一区二区三区四区| 欧美电影免费观看高清完整版在线| 欧美日韩大陆在线| 欧美日韩一级大片网址| 欧美日韩一区二区三区四区五区| 91国偷自产一区二区三区成为亚洲经典 | 日韩精品资源二区在线| 91精品国产免费| 日韩欧美国产成人一区二区| 日韩精品专区在线影院观看| 日韩欧美国产精品一区| 2020国产精品| 国产女主播视频一区二区| 欧美激情一区不卡| 亚洲欧美中日韩| 亚洲欧美激情小说另类| 一区二区三区在线免费| 午夜在线成人av| 热久久国产精品| 国产一区二区三区黄视频 | 久久精品亚洲一区二区三区浴池| 2023国产精华国产精品| 久久久久久一级片| 中文字幕亚洲精品在线观看| 亚洲日穴在线视频| 午夜精品一区二区三区免费视频| 日韩va亚洲va欧美va久久| 国产综合色在线| k8久久久一区二区三区| 色丁香久综合在线久综合在线观看| 欧美手机在线视频| 精品国产99国产精品| 中文字幕在线播放不卡一区| 一区二区三区精品视频在线| 日本成人中文字幕在线视频| 国产精品一区二区男女羞羞无遮挡| 成人av网址在线| 欧美日韩国产一级| 欧美精品一区二区三区蜜桃 | 亚洲另类中文字| 日韩成人一级片| 国产成人小视频| 欧美日韩一区视频| 久久精品欧美一区二区三区不卡| 国产精品久久久久7777按摩| 天天影视色香欲综合网老头| 成人性生交大片免费看中文网站| 欧美日韩中文字幕精品| 久久在线免费观看| 亚洲一区成人在线| 国产成人鲁色资源国产91色综 | 狠狠久久亚洲欧美| 色婷婷综合视频在线观看| 欧美一区二区福利在线| 亚洲欧美韩国综合色| 久久黄色级2电影| 91久久精品午夜一区二区| 精品免费国产一区二区三区四区| 一区二区三区视频在线看| 激情文学综合插| 欧美优质美女网站| 国产偷国产偷精品高清尤物| 日韩激情视频在线观看| 99国产精品一区| 久久亚洲捆绑美女| 五月天亚洲婷婷| 91在线观看成人| 久久久久免费观看| 免费看日韩精品| 欧美色爱综合网| 国产精品家庭影院| 国产精品一区一区三区| 日韩免费看的电影| 性做久久久久久免费观看欧美| 99久久99久久免费精品蜜臀| 久久综合色8888| 日本sm残虐另类| 欧美精品丝袜中出| 亚洲一区在线免费观看| 91网站在线播放| 中文字幕一区二区视频| 国产成人av福利| 精品国产电影一区二区| 久久av老司机精品网站导航| 欧美精品久久天天躁| 亚洲一区在线视频| 欧美图区在线视频| 一区二区不卡在线播放| 99精品视频中文字幕| 亚洲欧洲精品天堂一级| 成人91在线观看| 亚洲天堂成人网| 91在线观看地址| 亚洲图片你懂的| 色综合久久久久网| 一区二区三区四区五区视频在线观看| www.日韩精品| 中文字幕一区av| 在线精品视频一区二区三四| 亚洲精品第1页| 欧美日韩在线精品一区二区三区激情| 亚洲国产综合91精品麻豆| 欧亚洲嫩模精品一区三区| 亚洲国产日韩精品| 欧美乱熟臀69xxxxxx| 日av在线不卡| 国产亚洲欧美中文| 成人综合婷婷国产精品久久蜜臀| 国产精品另类一区| 色乱码一区二区三区88| 一区二区三区在线视频免费观看| 欧美性xxxxxxxx| 日本欧美在线观看| 精品福利二区三区| 成人午夜短视频| 亚洲午夜三级在线| 日韩欧美电影在线| 国产成a人无v码亚洲福利| 亚洲日本一区二区| 欧美日韩高清一区二区| 极品少妇一区二区三区精品视频| 久久久99精品免费观看| 99re66热这里只有精品3直播| 亚洲尤物在线视频观看| 欧美成人欧美edvon| 国产成人精品aa毛片| 亚洲一区二区偷拍精品| 日韩欧美国产电影| 99久久久无码国产精品| 午夜私人影院久久久久| 久久婷婷色综合| 欧美在线观看视频在线|