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

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

?? ch19.htm

?? Learning language of Visual C++6
?? HTM
?? 第 1 頁 / 共 3 頁
字號:
	<LI>DWORD dwContext&#160;&#160;The context identifier for the operation. For synchronous
	sessions, this is not an important parameter.
	<P>
	<LI>DWORD dwAccessType&#160;&#160;The access type: INTERNET_OPEN_TYPE_PRECONFIG (default),
	INTERNET_OPEN_TYPE_DIRECT, or INTERNET_OPEN_TYPE_PROXY.
	<P>
	<LI>LPCTSTR pstrProxyName&#160;&#160;The name of your proxy, if access is INTERNET_OPEN_TYPE_PROXY.
	<P>
	<LI>LPCTSTR pstrProxyBypass&#160;&#160;A list of addresses to be connected directly
	rather than through the proxy server, if access is INTERNET_OPEN_TYPE_PROXY.
	<P>
	<LI>DWORD dwFlags&#160;&#160;Options that can be OR'ed together. The available options
	are INTERNET_FLAG_DONT_CACHE, INTERNET_FLAG_ASYNC, and INTERNET_FLAG_OFFLINE.
</UL>

<P>dwAccessType<B> </B>defaults to using the value in the Registry. Obviously, an
application that insists on direct Internet access or proxy Internet access is less
useful than one that enables users to configure that information. Making users set
their Internet access type outside this program might be confusing, though. To set
your default Internet access, double-click the My Computer icon on your desktop,
then on the Control Panel, and then on the Internet tool in the Control Panel. Choose
the Connection tab (the version for Internet Explorer under Windows 95 is shown in
Figure 19.7) and complete the dialog box as appropriate for your setup. If you are
using NT or Windows 98, or if your browser version is different, you might see a
slightly different dialog, but you should still be able to choose your connection
type.</P>
<P><A HREF="javascript:popUp('19uvc07.gif')"><B>FIG. 19.7</B></A><B> </B><I>Set your
Internet connection settings once, and all applications can retrieve them from the
Registry.</I></P>
<P>

<UL>
	<LI>If you dial up to the Internet, select the Dial check box and fill in the parameters
	in the top half of the page.
	<P>
	<LI>If you connect to the Internet through a proxy server, select the Proxy check
	box and click the Settings button to identify your proxy addresses and ports.
	<P>
	<LI>If you are connected directly to the Internet, leave both check boxes unselected.
</UL>

<P>If you want to set up an <I>asynchronous</I> (nonblocking) session, for the reasons
discussed in the &quot;Using Windows Sockets&quot; section of Chapter 18, your options
in dwFlags must include INTERNET_FLAG_ASYNC. In addition, you must call the member
function EnableStatusCallback() to set up the callback function. When a request is
made through the session--such as the call to OpenURL() that occurs later in TryURL()--and
the response will not be immediate, a nonblocking session returns a pseudo error
code, ERROR_IO_PENDING. When the response is ready, these sessions automatically
invoke the callback function.</P>
<P>For this simple application, there is no need to allow the user to do other work
or interact with the user interface while waiting for the session to respond, so
the session is constructed as a blocking session and all the other default parameters
are also used:</P>
<P>
<PRE>     CInternetSession session;
</PRE>
<P>Having constructed the session, TryURL() goes on to add a line to m_out that echoes
the URL passed in as a parameter. The &quot;\r\n&quot; characters are <I>return</I>
and <I>newline</I>, and they separate the lines added to m_out. UpdateData(FALSE)
gets that onscreen:</P>
<P>
<PRE>     m_out += &quot;Trying &quot; + URL + &quot;\r\n&quot;;
     UpdateData(FALSE);
</PRE>
<P>Next is a call to the session's OpenURL() member function. This function returns
a pointer to one of several file types because the URL might have been to one of
four protocols:</P>

<UL>
	<LI>file:// opens a file. The function constructs a CStdioFile and returns a pointer
	to it.
	<P>
	<LI>ftp:// goes to an FTP site and returns a pointer to a CInternetFile object.
	<P>
	<LI>gopher:// goes to a Gopher site and returns a pointer to a CGopherFile object.
	<P>
	<LI>http:// goes to a World Wide Web site and returns a pointer to a CHttpFile object.
</UL>

<P>Because CGopherFile and CHttpFile both inherit from CInternetFile and because
you can be sure that TryURL() will not be passed a file:// URL, it is safe to cast
the returned pointer to a CInternetFile.</P>


<BLOCKQUOTE>
	<P>
<HR>
<strong>TIP:</strong> There is some confusion in Microsoft's online documentation whenever
	sample URLs are shown. A backslash (\) character will never appear in an URL. In
	any Microsoft example that includes backslashes, use forward slashes (/) instead.
	
<HR>


</BLOCKQUOTE>

<P>If the URL would not open, file will be NULL, or OpenURL()_ will throw an exception.
(For background on exceptions, see Chapter 26, &quot;Exceptions and Templates.&quot;)
Whereas in a normal application it would be a serious error if an URL didn't open,
in this application you are making up URLs to see whether they work, and it's expected
that some won't. As a result, you should catch these exceptions yourself and do just
enough to prevent runtime errors. In this case, it's enough to make sure that file
is NULL when an exception is thrown. To delete the exception and prevent memory leaks,
call CException::Delete(), which safely deletes the exception. The block of code
containing the call to OpenURL() is in Listing 19.3.</P>
<P>
<H4>Listing 19.3&#160;&#160;QueryDlg.cpp--CQueryDlg::TryURL()</H4>
<PRE>     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();
</PRE>
<PRE>     }
</PRE>
<P>If file is not NULL, this routine will display some of the Web page that was found.
It first echoes another line to m_out. Then, in a for loop, the routine calls CInternetFile::ReadString()
to fill the CString line with the characters in file up to the first \r\n, which
are stripped off. This code simply tacks line (and another \r\n) onto m_out. If you
would like to see more or less than the first 20 lines of the page, adjust the number
in this for loop. When the first few lines have been read, TryURL() closes and deletes
the file. That block of code is shown in Listing 19.4.</P>
<P>
<H4>Listing 19.4&#160;&#160;QueryDlg.cpp--CQueryDlg::TryURL()</H4>
<PRE>     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;
</PRE>
<PRE>     }
</PRE>
<P>If the file could not be opened, a message to that effect is added to m_out:</P>
<P>
<PRE>     else
     {
          m_out += &quot;No server found there. \r\n&quot;;
     }
</PRE>
<P>Then, whether the file existed or not, a line of dashes is tacked on m_out to
indicate the end of this attempt, and one last call to UpdateData(FALSE) puts the
new m_out onscreen:</P>
<P>
<PRE>     m_out += &quot;------------------------\r\n&quot;;
     UpdateData(FALSE);
}
</PRE>
<P>You can now build and run this application. If you enter <B>microsoft.com</B>
in the text box and click Query, you'll discover that there are Web pages at both
<B>http://microsoft.com</B> and <B>http://www.microsoft.com</B>. Figure 19.8 shows
the results of that query.</P>
<P><A HREF="javascript:popUp('19uvc08.gif')"><B>FIG. 19.8</B></A><B> </B><I>Query
can find Microsoft's Web sites.</I></P>
<P>If Query doesn't find Web pages at either the domain name you provided or <B>www.</B>
plus the domain name, it doesn't mean that the domain doesn't exist or even that
the organization that owns the domain name doesn't have a Web page. It does make
it less likely, however, that the organization both exists and has a Web page. If
you see a stream of HTML, you know for certain that the organization exists and has
a Web page. You might be able to read the HTML yourself, but even if you can't, you
can now connect to the site with a Web browser such as Microsoft's Internet Explorer.</P>
<P>
<H2><A NAME="Heading4"></A>Querying FTP Sites</H2>
<P>As part of a site name investigation, you should check whether there is an FTP
site, too. Most FTP sites have names like <B>ftp.company.com</B>, though some older
sites don't have names of that form. Checking for these sites isn't as simple as
just calling TryURL() again because TryURL() assumes that the URL leads to a file,
and URLs like <B>ftp.greatidea.org</B> lead to a list of files that cannot simply
be opened and read. Rather than make TryURL() even more complicated, add a protected
function to the class called TryFTPSite(CString host). (Right-click CQueryDlg in
the ClassView and choose Add Member Function to add the function. It can return void.)</P>
<P>TryFTPSite() has to establish a connection within the session, and if the connection
is established, it has to get some information that can be added to m_out to show
the user that the connection has been made. Getting a list of files is reasonably
complex; because this is just an illustrative application, the simpler task of getting
the name of the default FTP directory is the way to go. The code is in Listing 19.5.</P>
<P>
<H4>Listing 19.5&#160;&#160;QueryDlg.cpp--CQueryDlg::TryFTPSite()</H4>
<PRE>void CQueryDlg::TryFTPSite(CString host)
{
     CInternetSession session;
     m_out += &quot;Trying FTP site &quot; + host + &quot;\r\n&quot;;
     UpdateData(FALSE);
     CFtpConnection* connection = NULL;
     try
     {
          connection = session.GetFtpConnection(host);
     }
     catch (CInternetException* pEx)
     {
          //if anything went wrong, just set connection to NULL
          connection = NULL;
          pEx-&gt;Delete();
     }
     if (connection)
     {
          m_out += &quot;Connection established. \r\n&quot;;
          CString line;
          connection-&gt;GetCurrentDirectory(line);
          m_out += &quot;default directory is &quot; + line + &quot;\r\n&quot;;
          connection-&gt;Close();
          delete connection;
     }
     else
     {
          m_out += &quot;No server found there. \r\n&quot;;
     }
     m_out += &quot;------------------------\r\n&quot;;
     UpdateData(FALSE);
</PRE>
<PRE>}
</PRE>
<P>This code is very much like TryURL(), except that rather than open a file with
session.OpenURL(), it opens an FTP connection with session.GetFtpConnection(). Again,
exceptions are caught and essentially ignored, with the routine just making sure
that the connection pointer won't be used. The call to GetCurrentDirectory() returns
the directory on the remote site in which sessions start. The rest of the routine
is just like TryURL().</P>
<P>Add two lines at the end of OnQuery() to call this new function:</P>
<P>
<PRE>     TryFTPSite(m_host);
     TryFTPSite(&quot;ftp.&quot; + m_host);
</PRE>
<P>Build the application and try it: Figure 19.9 shows Query finding no FTP site
at <B>microsoft.com</B> and finding one at <B>ftp.microsoft.com</B>. The delay before
results start to appear might be a little disconcerting. You can correct this by
using asynchronous sockets, or <I>threading,</I> so that early results can be added
to the edit box while later results are still coming in over the wire. However, for
a simple demonstration application like this, just wait patiently until the results
appear. It might take several minutes, depending on network traffic between your
site and Microsoft's, your line speed, and so on.</P>
<P><A HREF="javascript:popUp('19uvc09.gif')"><B>FIG. 19.9</B></A><B> </B><I>Query
finds one Microsoft FTP site.</I></P>
<P>If Query doesn't find Web pages or FTP sites, perhaps this domain doesn't exist
at all or doesn't have any Internet services other than email, but there are a few
more investigative tricks available. The results of these investigations will definitely
add to your knowledge of existing sites.</P>
<P>
<H2><A NAME="Heading5"></A>Querying Gopher Sites</H2>
<P>As with FTP, TryURL() won't work when querying a Gopher site like <B>gopher.company.com</B>
because this returns a list of filenames instead of a single file. The solution is
to write a protected member function called TryGopherSite() that is almost identical
to TryFTPSite(), except that it opens a CGopherConnection. Also, rather than echo
a single line describing the default directory, it echoes a single line describing
the Gopher locator associated with the site. Add TryGopherSite to CQueryDlg by right-clicking
the classname in ClassView and choosing Add Member Function, as you did for TryFTPSite().
The code for TryGopherSite() is in Listing 19.6.</P>
<P>
<H4>Listing 19.6&#160;&#160;QueryDlg.cpp--CQueryDlg::TryGopherSite()</H4>
<PRE>void CQueryDlg::TryGopherSite(CString host)
{
     CInternetSession session;
     m_out += &quot;Trying Gopher site &quot; + host + &quot;\r\n&quot;;
     UpdateData(FALSE);
     CGopherConnection* connection = NULL;
     try
     {
          connection = session.GetGopherConnection(host);
     }
     catch (CInternetException* pEx)
     {
          //if anything went wrong, just set connection to NULL
          connection = NULL;
          pEx-&gt;Delete();
     }
     if (connection)
     {
          m_out += &quot;Connection established. \r\n&quot;;
          CString line;
          CGopherLocator locator = connection-&gt;CreateLocator(NULL, NULL, 
              GOPHER_TYPE_DIRECTORY);
          line = locator;
          m_out += &quot;first locator is &quot; + line + &quot;\r\n&quot;;
          connection-&gt;Close();
          delete connection;
     }
     else
     {
          m_out += &quot;No server found there. \r\n&quot;;
     }
     m_out += &quot;------------------------\r\n&quot;;
     UpdateData(FALSE);
</PRE>
<PRE>}
</PRE>
<P>The call to CreateLocator() takes three parameters. The first is the filename,
which might include wild cards. NULL means any file. The second parameter is a selector
that can be NULL. The third is one of the following types:</P>
<P>GOPHER_TYPE_TEXT_FILE</P>
<P>GOPHER_TYPE_DIRECTORY</P>
<P>GOPHER_TYPE_CSO</P>
<P>GOPHER_TYPE_ERROR</P>
<P>GOPHER_TYPE_MAC_BINHEX</P>
<P>GOPHER_TYPE_DOS_ARCHIVE</P>
<P>GOPHER_TYPE_UNIX_UUENCODED</P>
<P>GOPHER_TYPE_INDEX_SERVER</P>
<P>GOPHER_TYPE_TELNET</P>
<P>GOPHER_TYPE_BINARY</P>
<P>GOPHER_TYPE_REDUNDANT</P>
<P>GOPHER_TYPE_TN3270</P>
<P>GOPHER_TYPE_GIF</P>
<P>GOPHER_TYPE_IMAGE</P>
<P>GOPHER_TYPE_BITMAP</P>
<P>GOPHER_TYPE_MOVIE</P>
<P>GOPHER_TYPE_SOUND</P>
<P>GOPHER_TYPE_HTML</P>

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
制服视频三区第一页精品| 风流少妇一区二区| 欧美一级淫片007| 蜜臀av在线播放一区二区三区| 7878成人国产在线观看| 蜜桃视频一区二区三区在线观看| 日韩免费高清电影| 国产999精品久久| 国产精品高潮久久久久无| 日本韩国精品一区二区在线观看| 亚洲一区二区视频在线| 欧美一级国产精品| 国产a视频精品免费观看| 亚洲欧美视频在线观看视频| 精品视频999| 韩国在线一区二区| 亚洲啪啪综合av一区二区三区| 欧美在线免费播放| 国产综合色产在线精品| 亚洲情趣在线观看| 欧美不卡一二三| 99久免费精品视频在线观看| 日韩精品成人一区二区三区| 久久久99精品免费观看不卡| 色婷婷激情久久| 麻豆91精品视频| 亚洲九九爱视频| 精品免费视频一区二区| av中文一区二区三区| 日韩不卡一二三区| 亚洲色大成网站www久久九九| 6080日韩午夜伦伦午夜伦| 成人福利视频在线看| 日韩激情一二三区| 日韩毛片高清在线播放| 欧美电影免费观看高清完整版| 99re热这里只有精品免费视频 | 777亚洲妇女| 国产高清久久久| 天堂蜜桃一区二区三区| 亚洲欧洲精品成人久久奇米网| 日韩精品一区二区三区视频播放| 91色九色蝌蚪| 国产99久久久国产精品| 久久精品免费观看| 亚洲激情五月婷婷| 亚洲国产精品av| 欧美www视频| 欧美精品1区2区3区| 色呦呦网站一区| 粗大黑人巨茎大战欧美成人| 久草在线在线精品观看| 亚洲国产成人av| 亚洲欧美日韩电影| 国产精品国产自产拍高清av| 久久综合九色综合97_久久久| 欧美日韩国产经典色站一区二区三区| 91丨porny丨国产入口| 国产成a人亚洲精品| 国产一区中文字幕| 麻豆国产精品官网| 免费成人你懂的| 日本不卡一二三| 国产精品久久久久久久第一福利| 欧美日韩在线三区| 99久久精品情趣| 国产超碰在线一区| 国产综合久久久久久鬼色| 日韩 欧美一区二区三区| 午夜欧美在线一二页| 亚洲女女做受ⅹxx高潮| 亚洲视频1区2区| ●精品国产综合乱码久久久久 | 国产一区二区看久久| 日韩av午夜在线观看| 日韩在线卡一卡二| 麻豆精品国产传媒mv男同 | 精品88久久久久88久久久| 日韩一区二区三区在线| 欧美一区二区在线免费播放| 欧美一级艳片视频免费观看| 日韩一区二区三免费高清| 欧美不卡123| 久久久久久久久久久久电影 | 亚洲一区二区在线播放相泽| 亚洲一区二区视频在线| 日韩精品亚洲一区二区三区免费| 日韩精品一二三四| 韩国精品主播一区二区在线观看| 国产精品一区二区不卡| 成人午夜视频在线观看| 91亚洲资源网| 欧美日韩电影在线| 精品国产电影一区二区| 国产精品视频九色porn| 亚洲九九爱视频| 日韩电影在线一区| 国产成人亚洲精品青草天美| 99精品久久99久久久久| 欧美系列日韩一区| 日韩精品在线一区| 中文av一区二区| 亚洲成人av福利| 韩国v欧美v日本v亚洲v| a美女胸又www黄视频久久| 欧美日韩久久一区二区| 精品国内二区三区| 亚洲欧美色图小说| 青青草国产精品97视觉盛宴| 成人在线一区二区三区| 欧美日韩一区二区电影| 久久精品人人做人人综合| 亚洲精品视频一区二区| 奇米777欧美一区二区| 国产成人综合精品三级| 欧美日韩国产高清一区二区| 国产午夜久久久久| 亚洲动漫第一页| 丁香六月综合激情| 91精品蜜臀在线一区尤物| 国产精品女同一区二区三区| 日本亚洲免费观看| 99久久婷婷国产| 精品国产免费人成电影在线观看四季| 中文字幕一区二区三区在线不卡 | 亚洲成人激情自拍| 大胆亚洲人体视频| 91精品国产色综合久久不卡电影| 中文字幕电影一区| 免费在线观看不卡| 欧美中文一区二区三区| 欧美国产日韩a欧美在线观看| 日韩成人av影视| 欧美性猛片aaaaaaa做受| 中文字幕成人av| 国模大尺度一区二区三区| 欧美三级电影精品| 日韩一区在线看| 粉嫩蜜臀av国产精品网站| 欧美成人精品高清在线播放| 亚洲第一久久影院| 色噜噜夜夜夜综合网| 国产欧美精品一区aⅴ影院 | 三级亚洲高清视频| 在线免费观看视频一区| 中文久久乱码一区二区| 国内久久精品视频| 日韩女同互慰一区二区| 日韩精品免费专区| 欧美色偷偷大香| 亚洲午夜影视影院在线观看| 99久久精品国产一区| 国产日产欧美精品一区二区三区| 精品写真视频在线观看| 欧美一级日韩一级| 日韩成人精品在线| 精品欧美乱码久久久久久1区2区| 日韩欧美国产一区二区三区| 亚洲高清视频中文字幕| 欧美亚洲国产怡红院影院| 亚洲精品乱码久久久久久| 91在线丨porny丨国产| 1区2区3区欧美| 色综合天天狠狠| 亚洲精品一二三| 色噜噜狠狠色综合中国 | 一二三四社区欧美黄| 97久久超碰国产精品电影| 亚洲欧美在线视频观看| 成人app下载| 亚洲精品国产品国语在线app| 色94色欧美sute亚洲线路一ni| 亚洲精品国产高清久久伦理二区| 在线亚洲欧美专区二区| 亚洲韩国精品一区| 欧美一区中文字幕| 国产在线日韩欧美| 久久久www成人免费无遮挡大片| 国产精品99久久久| 中文字幕一区二| 欧美色图片你懂的| 免费观看30秒视频久久| 26uuu成人网一区二区三区| 国产不卡在线播放| 亚洲女同ⅹxx女同tv| 欧美日韩亚洲综合在线| 青青草91视频| 国产欧美日韩精品在线| 色婷婷国产精品综合在线观看| 午夜精品久久久久久久蜜桃app| 日韩一级视频免费观看在线| 国产精品911| 一区二区三区四区蜜桃| 欧美一区二区久久| 国产精品911| 亚洲一级二级在线| 久久午夜羞羞影院免费观看| 99久久精品免费| 秋霞午夜av一区二区三区| 国产精品午夜春色av|