﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>C++博客-edog-随笔分类-.NET技术</title><link>http://www.cppblog.com/edog/category/475.html</link><description>冰冻热狗</description><language>zh-cn</language><lastBuildDate>Wed, 21 May 2008 21:18:15 GMT</lastBuildDate><pubDate>Wed, 21 May 2008 21:18:15 GMT</pubDate><ttl>60</ttl><item><title>Asp的时间格式问题</title><link>http://www.cppblog.com/edog/archive/2006/06/11/8411.html</link><dc:creator>冰冻热狗</dc:creator><author>冰冻热狗</author><pubDate>Sun, 11 Jun 2006 05:39:00 GMT</pubDate><guid>http://www.cppblog.com/edog/archive/2006/06/11/8411.html</guid><wfw:comment>http://www.cppblog.com/edog/comments/8411.html</wfw:comment><comments>http://www.cppblog.com/edog/archive/2006/06/11/8411.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/edog/comments/commentRss/8411.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/edog/services/trackbacks/8411.html</trackback:ping><description><![CDATA[
		<p>现象：使用ASP取当前时间NOW，返回的时间带有上下午字样，导致无法写入datetime字段。<br />原因：安装了WIN2000番茄乐园版，该版本把系统时间修改为带上下午格式。</p>
		<p>方法1：<br />1、控制面板－－区域和语言选项－－把时间设置为24小时格式。<br />2、打开注册表建立HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\OLEAUT\VarConversionLocaleSetting = 2 (DWORD) <br />备注：OLEAUT 项可能不存在。如果它不存在，则必须先创建该项。<br />3、重新启动IIS。</p>
		<p>问题解决，原理是强制使asp时间使用区域格式。</p>
		<p>
				<br />方法2：<br />查找注册表，全部匹配，把iTime的值全部改成1 。 <br />然后修改服务器系统时间，重起机器完全正常了～<br />（此方法试过好像不行）<br /></p>
<img src ="http://www.cppblog.com/edog/aggbug/8411.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/edog/" target="_blank">冰冻热狗</a> 2006-06-11 13:39 <a href="http://www.cppblog.com/edog/archive/2006/06/11/8411.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>用VS2003调试ASP的方法和体会</title><link>http://www.cppblog.com/edog/archive/2006/03/15/4157.html</link><dc:creator>冰冻热狗</dc:creator><author>冰冻热狗</author><pubDate>Tue, 14 Mar 2006 16:08:00 GMT</pubDate><guid>http://www.cppblog.com/edog/archive/2006/03/15/4157.html</guid><wfw:comment>http://www.cppblog.com/edog/comments/4157.html</wfw:comment><comments>http://www.cppblog.com/edog/archive/2006/03/15/4157.html#Feedback</comments><slash:comments>4</slash:comments><wfw:commentRss>http://www.cppblog.com/edog/comments/commentRss/4157.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/edog/services/trackbacks/4157.html</trackback:ping><description><![CDATA[<P>一直以来，和很多朋友一样，我调试ASP一般都是用editplus，当然，界面部分还是要用用什么frontpage之类的啦。 前段时间写.net项目，装了一个VS.net2003，最近要写一个asp的项目，后来想想用vs20003来试试吧。 <BR>1、打开VS2003，先新建立一个项目，选Visual Basic项目--空WEB项目，名字就叫webproject1，然后可以在资源管理器（是VS的不是windows的）里看到解决方案。 <BR></P>
<P align=center><IMG alt="" hspace=0 src="E:\SMB\ahhge\sample\1.gif" align=baseline border=0></P>
<P><BR>2、点项文件栏上的"项目"，然后点"webproject1属性"--"配置属性"--"调试"里，把"ASP.NET调试"去掉，把"ASP"调试打开。&nbsp;</P>
<P align=center><IMG alt="" hspace=0 src="E:\SMB\ahhge\sample\3.gif" align=baseline border=0></P>
<P><BR>3、右键webproject1，添加新项---WEB窗体，名称叫index.asp（注意名称不是aspx，是asp）。然后可以看到index.asp的HTML处理编辑状态。 <BR>4、把现成的代码全部删除，因为这个是VS自动生成的，当中有些代码是用于asp.net的。然后你就可以自由编写你的ASP页面了。在编写代码的时候，VS会提供一些自动完成功能，很方便的。<BR>&nbsp;<BR>5、现在准备调试。在资源管理器中index.asp，右键，设置为起始页。 <BR>6、然后点工具栏上的"三角"（哈哈，就是播放键）啦，这个就是debug的调试。 <BR>7、然后会跳出一个窗口让你输入本机密码，你就输入你登录用户的密码好了。 IE跳出来了，页面中显示出"VS下调试ASP项目"，哈，调试成功了！ <BR>&nbsp;<BR>结束调试的话你可以在VS里点工具栏上的那个"方块"（就是停止调试），也可以直接把IE关掉，也会自动停止调试的。 </P>
<P>好了，下面来谈谈我的一点经验和体会吧。 <BR>1、VS调试ASP程序比较慢，这个慢是体现在打开IE页面时，所以我建议一般的写代码和编程就在VS里，调试的时候就像以前那样，直接开个IE进行调试。但是，对于复杂的问题，涉及到流程错误的，我还是喜欢在VS里用单步调试，用F9在某个地方设个断点，然后用F10进行跟踪，这样对于程序的流程，变量值都可以很好的看出来（这些调试技巧大家可以参考一些asp.net方面的书，或是以前的VS6的书也行），解决复杂问题也就快了许多。 </P>
<P>2、建立新页面文件时，我建议还是直接进到目录中，然后建立好，再到VS的资源管理器中，用添加现有项进行导入，这样建立的文件没有垃圾代码。 </P>
<P>3、VS2003可以提供很好的自动完成功能，大家可以充分的利用。 </P>
<P>4、VS.net可以实现控件拖放加载，你可以在左边的"工具箱"--"HTML"里可以看到，直接点了，按住MOUSE左键直接拖到你想添加的地方。由于VS.net是针对.net的，所以一些HTML控件的属性中也体现了这些，比如"runat"这样的属性，在asp中是根本用不起来的。不过大多数控件的属性都是可以的，而且可以在"设计"视图下进行方便的设置属性好啦就说这么多吧. 大家可以慢慢体会：）有人说DW不错，我没有用过，不知道怎么样，也有人说DW有不少垃圾代码，呵呵：P </P>
<P>本文摘录自：<A href="http://www.81819.com/Article/2004-3-1/news2004-6-2535008925.html">http://www.81819.com/Article/2004-3-1/news2004-6-2535008925.html</A></P>
<P>&nbsp;</P><img src ="http://www.cppblog.com/edog/aggbug/4157.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/edog/" target="_blank">冰冻热狗</a> 2006-03-15 00:08 <a href="http://www.cppblog.com/edog/archive/2006/03/15/4157.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>数据库表中列类型的修改和ALTER的用法</title><link>http://www.cppblog.com/edog/archive/2006/03/02/3664.html</link><dc:creator>冰冻热狗</dc:creator><author>冰冻热狗</author><pubDate>Thu, 02 Mar 2006 15:43:00 GMT</pubDate><guid>http://www.cppblog.com/edog/archive/2006/03/02/3664.html</guid><wfw:comment>http://www.cppblog.com/edog/comments/3664.html</wfw:comment><comments>http://www.cppblog.com/edog/archive/2006/03/02/3664.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/edog/comments/commentRss/3664.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/edog/services/trackbacks/3664.html</trackback:ping><description><![CDATA[<p>1、修改列类型，比如列为nvarch类型，修改其长度为100：</p>
<p>ALTER TABLE tb ALTER COLUMN col nvarchar(100)</p>
<p>2、增加一列：</p>
<p>ALTER TABLE tb ADD col2 nvarchar(100) null</p>
<p>表中存在数据时，新增加的列必须为null或者identity。</p>
<p>3、增加约束，设定列col3的缺省值为0：</p>
<p>ALTER TABLE tb ADD CONSTRAINT DF_col3 DEFAULT 0 FOR col3<br></p>
<img src ="http://www.cppblog.com/edog/aggbug/3664.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/edog/" target="_blank">冰冻热狗</a> 2006-03-02 23:43 <a href="http://www.cppblog.com/edog/archive/2006/03/02/3664.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>用CHttpFile实现简单的GET/POST数据</title><link>http://www.cppblog.com/edog/archive/2005/12/06/1554.html</link><dc:creator>冰冻热狗</dc:creator><author>冰冻热狗</author><pubDate>Mon, 05 Dec 2005 16:19:00 GMT</pubDate><guid>http://www.cppblog.com/edog/archive/2005/12/06/1554.html</guid><wfw:comment>http://www.cppblog.com/edog/comments/1554.html</wfw:comment><comments>http://www.cppblog.com/edog/archive/2005/12/06/1554.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.cppblog.com/edog/comments/commentRss/1554.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/edog/services/trackbacks/1554.html</trackback:ping><description><![CDATA[一、GET 数据，下载网页，文件等，用于可下载的文件，不能用于服务端运行的程序，比如.aspx文件等，否则会返回500错误。<BR>
<DIV style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><IMG src="http://www.cppblog.com/images/OutliningIndicators/None.gif" align=top><SPAN style="COLOR: #000000">CString&nbsp;strSentence,&nbsp;strWriteName</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">1.htm</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">;<BR><IMG src="http://www.cppblog.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;CString&nbsp;strFileName</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">http://localhost/InDesign/</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">&nbsp;strWriteName;<BR><IMG src="http://www.cppblog.com/images/OutliningIndicators/None.gif" align=top><BR><IMG src="http://www.cppblog.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;CInternetSession&nbsp;sess;<BR><IMG src="http://www.cppblog.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;CHttpFile</SPAN><SPAN style="COLOR: #000000">*</SPAN><SPAN style="COLOR: #000000">&nbsp;fileGet;<BR><IMG src="http://www.cppblog.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">try</SPAN><SPAN style="COLOR: #000000"><BR><IMG id=Codehighlighter1_161_213_Open_Image onclick="this.style.display='none'; Codehighlighter1_161_213_Open_Text.style.display='none'; Codehighlighter1_161_213_Closed_Image.style.display='inline'; Codehighlighter1_161_213_Closed_Text.style.display='inline';" src="http://www.cppblog.com/images/OutliningIndicators/ExpandedBlockStart.gif" align=top><IMG id=Codehighlighter1_161_213_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_161_213_Closed_Text.style.display='none'; Codehighlighter1_161_213_Open_Image.style.display='inline'; Codehighlighter1_161_213_Open_Text.style.display='inline';" src="http://www.cppblog.com/images/OutliningIndicators/ContractedBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN id=Codehighlighter1_161_213_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.cppblog.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_161_213_Open_Text><SPAN style="COLOR: #000000">{<BR><IMG src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;fileGet</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">(CHttpFile</SPAN><SPAN style="COLOR: #000000">*</SPAN><SPAN style="COLOR: #000000">)sess.OpenURL(strFileName);<BR><IMG src="http://www.cppblog.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;}</SPAN></SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cppblog.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">catch</SPAN><SPAN style="COLOR: #000000">(CException</SPAN><SPAN style="COLOR: #000000">*</SPAN><SPAN style="COLOR: #000000">&nbsp;e)<BR><IMG id=Codehighlighter1_238_265_Open_Image onclick="this.style.display='none'; Codehighlighter1_238_265_Open_Text.style.display='none'; Codehighlighter1_238_265_Closed_Image.style.display='inline'; Codehighlighter1_238_265_Closed_Text.style.display='inline';" src="http://www.cppblog.com/images/OutliningIndicators/ExpandedBlockStart.gif" align=top><IMG id=Codehighlighter1_238_265_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_238_265_Closed_Text.style.display='none'; Codehighlighter1_238_265_Open_Image.style.display='inline'; Codehighlighter1_238_265_Open_Text.style.display='inline';" src="http://www.cppblog.com/images/OutliningIndicators/ContractedBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN id=Codehighlighter1_238_265_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.cppblog.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_238_265_Open_Text><SPAN style="COLOR: #000000">{<BR><IMG src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;fileGet&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">0</SPAN><SPAN style="COLOR: #000000">;<BR><IMG src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">throw</SPAN><SPAN style="COLOR: #000000">;<BR><IMG src="http://www.cppblog.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;}</SPAN></SPAN><SPAN style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;<BR><IMG src="http://www.cppblog.com/images/OutliningIndicators/None.gif" align=top><BR><IMG src="http://www.cppblog.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">if</SPAN><SPAN style="COLOR: #000000">(fileGet)<BR><IMG id=Codehighlighter1_283_977_Open_Image onclick="this.style.display='none'; Codehighlighter1_283_977_Open_Text.style.display='none'; Codehighlighter1_283_977_Closed_Image.style.display='inline'; Codehighlighter1_283_977_Closed_Text.style.display='inline';" src="http://www.cppblog.com/images/OutliningIndicators/ExpandedBlockStart.gif" align=top><IMG id=Codehighlighter1_283_977_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_283_977_Closed_Text.style.display='none'; Codehighlighter1_283_977_Open_Image.style.display='inline'; Codehighlighter1_283_977_Open_Text.style.display='inline';" src="http://www.cppblog.com/images/OutliningIndicators/ContractedBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN id=Codehighlighter1_283_977_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.cppblog.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_283_977_Open_Text><SPAN style="COLOR: #000000">{<BR><IMG src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;DWORD&nbsp;dwStatus;<BR><IMG src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;DWORD&nbsp;dwBuffLen&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">sizeof</SPAN><SPAN style="COLOR: #000000">(dwStatus);<BR><IMG src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;BOOL&nbsp;bSuccess&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;fileGet</SPAN><SPAN style="COLOR: #000000">-&gt;</SPAN><SPAN style="COLOR: #000000">QueryInfo(HTTP_QUERY_STATUS_CODE</SPAN><SPAN style="COLOR: #000000">|</SPAN><SPAN style="COLOR: #000000">HTTP_QUERY_FLAG_NUMBER,&nbsp;</SPAN><SPAN style="COLOR: #000000">&amp;</SPAN><SPAN style="COLOR: #000000">dwStatus,&nbsp;</SPAN><SPAN style="COLOR: #000000">&amp;</SPAN><SPAN style="COLOR: #000000">dwBuffLen);<BR><IMG src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align=top><BR><IMG src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">if</SPAN><SPAN style="COLOR: #000000">(&nbsp;bSuccess&nbsp;</SPAN><SPAN style="COLOR: #000000">&amp;&amp;</SPAN><SPAN style="COLOR: #000000">&nbsp;dwStatus</SPAN><SPAN style="COLOR: #000000">&gt;=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">200</SPAN><SPAN style="COLOR: #000000">&amp;&amp;</SPAN><SPAN style="COLOR: #000000">&nbsp;dwStatus</SPAN><SPAN style="COLOR: #000000">&lt;</SPAN><SPAN style="COLOR: #000000">300</SPAN><SPAN style="COLOR: #000000">&nbsp;)&nbsp;<BR><IMG id=Codehighlighter1_503_837_Open_Image onclick="this.style.display='none'; Codehighlighter1_503_837_Open_Text.style.display='none'; Codehighlighter1_503_837_Closed_Image.style.display='inline'; Codehighlighter1_503_837_Closed_Text.style.display='inline';" src="http://www.cppblog.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_503_837_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_503_837_Closed_Text.style.display='none'; Codehighlighter1_503_837_Open_Image.style.display='inline'; Codehighlighter1_503_837_Open_Text.style.display='inline';" src="http://www.cppblog.com/images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN id=Codehighlighter1_503_837_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.cppblog.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_503_837_Open_Text><SPAN style="COLOR: #000000">{&nbsp;<BR><IMG src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CStdioFile&nbsp;fileWrite;&nbsp;<BR><IMG src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">if</SPAN><SPAN style="COLOR: #000000">(fileWrite.Open(strWriteName,&nbsp;CFile::modeWrite</SPAN><SPAN style="COLOR: #000000">|</SPAN><SPAN style="COLOR: #000000">CFile::modeCreate))<BR><IMG id=Codehighlighter1_607_766_Open_Image onclick="this.style.display='none'; Codehighlighter1_607_766_Open_Text.style.display='none'; Codehighlighter1_607_766_Closed_Image.style.display='inline'; Codehighlighter1_607_766_Closed_Text.style.display='inline';" src="http://www.cppblog.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_607_766_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_607_766_Closed_Text.style.display='none'; Codehighlighter1_607_766_Open_Image.style.display='inline'; Codehighlighter1_607_766_Open_Text.style.display='inline';" src="http://www.cppblog.com/images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN id=Codehighlighter1_607_766_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.cppblog.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_607_766_Open_Text><SPAN style="COLOR: #000000">{&nbsp;<BR><IMG src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">while</SPAN><SPAN style="COLOR: #000000">(fileGet</SPAN><SPAN style="COLOR: #000000">-&gt;</SPAN><SPAN style="COLOR: #000000">ReadString(strSentence))<BR><IMG id=Codehighlighter1_658_711_Open_Image onclick="this.style.display='none'; Codehighlighter1_658_711_Open_Text.style.display='none'; Codehighlighter1_658_711_Closed_Image.style.display='inline'; Codehighlighter1_658_711_Closed_Text.style.display='inline';" src="http://www.cppblog.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_658_711_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_658_711_Closed_Text.style.display='none'; Codehighlighter1_658_711_Open_Image.style.display='inline'; Codehighlighter1_658_711_Open_Text.style.display='inline';" src="http://www.cppblog.com/images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN id=Codehighlighter1_658_711_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.cppblog.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_658_711_Open_Text><SPAN style="COLOR: #000000">{<BR><IMG src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;fileWrite.WriteString(strSentence</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">\n</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">);<BR><IMG src="http://www.cppblog.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</SPAN></SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;fileWrite.Close();<BR><IMG src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;AfxMessageBox(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">下载完毕</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">);<BR><IMG src="http://www.cppblog.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</SPAN></SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">else</SPAN><SPAN style="COLOR: #000000"><BR><IMG id=Codehighlighter1_779_833_Open_Image onclick="this.style.display='none'; Codehighlighter1_779_833_Open_Text.style.display='none'; Codehighlighter1_779_833_Closed_Image.style.display='inline'; Codehighlighter1_779_833_Closed_Text.style.display='inline';" src="http://www.cppblog.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_779_833_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_779_833_Closed_Text.style.display='none'; Codehighlighter1_779_833_Open_Image.style.display='inline'; Codehighlighter1_779_833_Open_Text.style.display='inline';" src="http://www.cppblog.com/images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN id=Codehighlighter1_779_833_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.cppblog.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_779_833_Open_Text><SPAN style="COLOR: #000000">{<BR><IMG src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;AfxMessageBox(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">本地文件</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">strWriteName</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">打开出错.</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">);&nbsp;<BR><IMG src="http://www.cppblog.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</SPAN></SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cppblog.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</SPAN></SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">else</SPAN><SPAN style="COLOR: #000000">&nbsp;<BR><IMG id=Codehighlighter1_849_936_Open_Image onclick="this.style.display='none'; Codehighlighter1_849_936_Open_Text.style.display='none'; Codehighlighter1_849_936_Closed_Image.style.display='inline'; Codehighlighter1_849_936_Closed_Text.style.display='inline';" src="http://www.cppblog.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_849_936_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_849_936_Closed_Text.style.display='none'; Codehighlighter1_849_936_Open_Image.style.display='inline'; Codehighlighter1_849_936_Open_Text.style.display='inline';" src="http://www.cppblog.com/images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN id=Codehighlighter1_849_936_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.cppblog.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_849_936_Open_Text><SPAN style="COLOR: #000000">{<BR><IMG src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;strSentence.Format(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">打开网页文件出错，错误码：%d</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">,&nbsp;dwStatus);<BR><IMG src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;AfxMessageBox(strSentence);<BR><IMG src="http://www.cppblog.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</SPAN></SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;fileGet</SPAN><SPAN style="COLOR: #000000">-&gt;</SPAN><SPAN style="COLOR: #000000">Close();<BR><IMG src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;delete&nbsp;fileGet;<BR><IMG src="http://www.cppblog.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;}</SPAN></SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cppblog.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">else</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cppblog.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;AfxMessageBox(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">不能找到网页文件！</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">);<BR><IMG src="http://www.cppblog.com/images/OutliningIndicators/None.gif" align=top><BR><IMG src="http://www.cppblog.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;sess.Close();</SPAN></DIV><BR>二、POST 数据，比如用于提交注册信息等<BR>
<DIV style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><IMG src="http://www.cppblog.com/images/OutliningIndicators/None.gif" align=top><SPAN style="COLOR: #000000">CString&nbsp;strHttpName</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">http://localhost/TestReg/RegForm.aspx</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">;&nbsp;</SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">&nbsp;需要提交数据的页面</SPAN><SPAN style="COLOR: #008000"><BR><IMG src="http://www.cppblog.com/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;CString&nbsp;strFormData&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">username=abc&amp;password=123</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">&nbsp;需要提交的数据</SPAN><SPAN style="COLOR: #008000"><BR><IMG src="http://www.cppblog.com/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cppblog.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;CInternetSession&nbsp;sess;<BR><IMG src="http://www.cppblog.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;CHttpFile</SPAN><SPAN style="COLOR: #000000">*</SPAN><SPAN style="COLOR: #000000">&nbsp;fileGet;<BR><IMG src="http://www.cppblog.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;CString&nbsp;strHeaders&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;_T(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">Content-Type:&nbsp;application/x-www-form-urlencoded</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">);&nbsp;</SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">&nbsp;请求头</SPAN><SPAN style="COLOR: #008000"><BR><IMG src="http://www.cppblog.com/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cppblog.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">try</SPAN><SPAN style="COLOR: #000000"><BR><IMG id=Codehighlighter1_274_332_Open_Image onclick="this.style.display='none'; Codehighlighter1_274_332_Open_Text.style.display='none'; Codehighlighter1_274_332_Closed_Image.style.display='inline'; Codehighlighter1_274_332_Closed_Text.style.display='inline';" src="http://www.cppblog.com/images/OutliningIndicators/ExpandedBlockStart.gif" align=top><IMG id=Codehighlighter1_274_332_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_274_332_Closed_Text.style.display='none'; Codehighlighter1_274_332_Open_Image.style.display='inline'; Codehighlighter1_274_332_Open_Text.style.display='inline';" src="http://www.cppblog.com/images/OutliningIndicators/ContractedBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN id=Codehighlighter1_274_332_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.cppblog.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_274_332_Open_Text><SPAN style="COLOR: #000000">{<BR><IMG src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;fileGet</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">(CHttpFile</SPAN><SPAN style="COLOR: #000000">*</SPAN><SPAN style="COLOR: #000000">)sess.OpenURL(strHttpName);</SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">打开文件</SPAN><SPAN style="COLOR: #008000"><BR><IMG src="http://www.cppblog.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align=top></SPAN><SPAN style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;}</SPAN></SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cppblog.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">catch</SPAN><SPAN style="COLOR: #000000">(CException</SPAN><SPAN style="COLOR: #000000">*</SPAN><SPAN style="COLOR: #000000">&nbsp;e)<BR><IMG id=Codehighlighter1_357_384_Open_Image onclick="this.style.display='none'; Codehighlighter1_357_384_Open_Text.style.display='none'; Codehighlighter1_357_384_Closed_Image.style.display='inline'; Codehighlighter1_357_384_Closed_Text.style.display='inline';" src="http://www.cppblog.com/images/OutliningIndicators/ExpandedBlockStart.gif" align=top><IMG id=Codehighlighter1_357_384_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_357_384_Closed_Text.style.display='none'; Codehighlighter1_357_384_Open_Image.style.display='inline'; Codehighlighter1_357_384_Open_Text.style.display='inline';" src="http://www.cppblog.com/images/OutliningIndicators/ContractedBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN id=Codehighlighter1_357_384_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.cppblog.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_357_384_Open_Text><SPAN style="COLOR: #000000">{<BR><IMG src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;fileGet&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">0</SPAN><SPAN style="COLOR: #000000">;<BR><IMG src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">throw</SPAN><SPAN style="COLOR: #000000">;<BR><IMG src="http://www.cppblog.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;}</SPAN></SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cppblog.com/images/OutliningIndicators/None.gif" align=top><BR><IMG src="http://www.cppblog.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;CString&nbsp;strSentence,&nbsp;strGetSentence&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">""</SPAN><SPAN style="COLOR: #000000">;<BR><IMG src="http://www.cppblog.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">if</SPAN><SPAN style="COLOR: #000000">(fileGet)<BR><IMG id=Codehighlighter1_444_1102_Open_Image onclick="this.style.display='none'; Codehighlighter1_444_1102_Open_Text.style.display='none'; Codehighlighter1_444_1102_Closed_Image.style.display='inline'; Codehighlighter1_444_1102_Closed_Text.style.display='inline';" src="http://www.cppblog.com/images/OutliningIndicators/ExpandedBlockStart.gif" align=top><IMG id=Codehighlighter1_444_1102_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_444_1102_Closed_Text.style.display='none'; Codehighlighter1_444_1102_Open_Image.style.display='inline'; Codehighlighter1_444_1102_Open_Text.style.display='inline';" src="http://www.cppblog.com/images/OutliningIndicators/ContractedBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN id=Codehighlighter1_444_1102_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.cppblog.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_444_1102_Open_Text><SPAN style="COLOR: #000000">{<BR><IMG src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;DWORD&nbsp;dwStatus;<BR><IMG src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;DWORD&nbsp;dwBuffLen&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">sizeof</SPAN><SPAN style="COLOR: #000000">(dwStatus);<BR><IMG src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;BOOL&nbsp;bSuccess&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;fileGet</SPAN><SPAN style="COLOR: #000000">-&gt;</SPAN><SPAN style="COLOR: #000000">QueryInfo(HTTP_QUERY_STATUS_CODE</SPAN><SPAN style="COLOR: #000000">|</SPAN><SPAN style="COLOR: #000000">HTTP_QUERY_FLAG_NUMBER,&nbsp;</SPAN><SPAN style="COLOR: #000000">&amp;</SPAN><SPAN style="COLOR: #000000">dwStatus,&nbsp;</SPAN><SPAN style="COLOR: #000000">&amp;</SPAN><SPAN style="COLOR: #000000">dwBuffLen);<BR><IMG src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">if</SPAN><SPAN style="COLOR: #000000">(&nbsp;bSuccess&nbsp;</SPAN><SPAN style="COLOR: #000000">&amp;&amp;</SPAN><SPAN style="COLOR: #000000">&nbsp;dwStatus</SPAN><SPAN style="COLOR: #000000">&gt;=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">200</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">&amp;&amp;</SPAN><SPAN style="COLOR: #000000">dwStatus</SPAN><SPAN style="COLOR: #000000">&lt;</SPAN><SPAN style="COLOR: #000000">300</SPAN><SPAN style="COLOR: #000000">&nbsp;)<BR><IMG id=Codehighlighter1_662_961_Open_Image onclick="this.style.display='none'; Codehighlighter1_662_961_Open_Text.style.display='none'; Codehighlighter1_662_961_Closed_Image.style.display='inline'; Codehighlighter1_662_961_Closed_Text.style.display='inline';" src="http://www.cppblog.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_662_961_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_662_961_Closed_Text.style.display='none'; Codehighlighter1_662_961_Open_Image.style.display='inline'; Codehighlighter1_662_961_Open_Text.style.display='inline';" src="http://www.cppblog.com/images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN id=Codehighlighter1_662_961_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.cppblog.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_662_961_Open_Text><SPAN style="COLOR: #000000">{&nbsp;<BR><IMG src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;BOOL&nbsp;result&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;fileGet</SPAN><SPAN style="COLOR: #000000">-&gt;</SPAN><SPAN style="COLOR: #000000">SendRequest(strHeaders,&nbsp;(LPVOID)(LPCTSTR)strFormData,&nbsp;strFormData.GetLength());<BR><IMG src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">while</SPAN><SPAN style="COLOR: #000000">(fileGet</SPAN><SPAN style="COLOR: #000000">-&gt;</SPAN><SPAN style="COLOR: #000000">ReadString(strSentence))&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">&nbsp;读取提交数据后的返回结果</SPAN><SPAN style="COLOR: #008000"><BR><IMG id=Codehighlighter1_833_911_Open_Image onclick="this.style.display='none'; Codehighlighter1_833_911_Open_Text.style.display='none'; Codehighlighter1_833_911_Closed_Image.style.display='inline'; Codehighlighter1_833_911_Closed_Text.style.display='inline';" src="http://www.cppblog.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_833_911_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_833_911_Closed_Text.style.display='none'; Codehighlighter1_833_911_Open_Image.style.display='inline'; Codehighlighter1_833_911_Open_Text.style.display='inline';" src="http://www.cppblog.com/images/OutliningIndicators/ContractedSubBlock.gif" align=top></SPAN><SPAN style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN id=Codehighlighter1_833_911_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.cppblog.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_833_911_Open_Text><SPAN style="COLOR: #000000">{<BR><IMG src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;strGetSentence&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;strGetSentence&nbsp;</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">&nbsp;strSentence&nbsp;</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">char</SPAN><SPAN style="COLOR: #000000">(</SPAN><SPAN style="COLOR: #000000">13</SPAN><SPAN style="COLOR: #000000">)&nbsp;</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">char</SPAN><SPAN style="COLOR: #000000">(</SPAN><SPAN style="COLOR: #000000">10</SPAN><SPAN style="COLOR: #000000">);<BR><IMG src="http://www.cppblog.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</SPAN></SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;AfxMessageBox(strGetSentence);&nbsp;</SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">&nbsp;显示返回网页内容</SPAN><SPAN style="COLOR: #008000"><BR><IMG src="http://www.cppblog.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top></SPAN><SPAN style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</SPAN></SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">else</SPAN><SPAN style="COLOR: #000000">&nbsp;<BR><IMG id=Codehighlighter1_973_1058_Open_Image onclick="this.style.display='none'; Codehighlighter1_973_1058_Open_Text.style.display='none'; Codehighlighter1_973_1058_Closed_Image.style.display='inline'; Codehighlighter1_973_1058_Closed_Text.style.display='inline';" src="http://www.cppblog.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_973_1058_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_973_1058_Closed_Text.style.display='none'; Codehighlighter1_973_1058_Open_Image.style.display='inline'; Codehighlighter1_973_1058_Open_Text.style.display='inline';" src="http://www.cppblog.com/images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN id=Codehighlighter1_973_1058_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.cppblog.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_973_1058_Open_Text><SPAN style="COLOR: #000000">{<BR><IMG src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;strSentence.Format(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">POST出错，错误码：%d</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">,&nbsp;dwStatus);<BR><IMG src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;AfxMessageBox(strSentence);<BR><IMG src="http://www.cppblog.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</SPAN></SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR><IMG src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;fileGet</SPAN><SPAN style="COLOR: #000000">-&gt;</SPAN><SPAN style="COLOR: #000000">Close();<BR><IMG src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;delete&nbsp;fileGet;<BR><IMG src="http://www.cppblog.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;}</SPAN></SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cppblog.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">else</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cppblog.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;AfxMessageBox(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">不能找到网页文件！</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">);<BR><IMG src="http://www.cppblog.com/images/OutliningIndicators/None.gif" align=top><BR><IMG src="http://www.cppblog.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;sess.Close();</SPAN></DIV><BR><img src ="http://www.cppblog.com/edog/aggbug/1554.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/edog/" target="_blank">冰冻热狗</a> 2005-12-06 00:19 <a href="http://www.cppblog.com/edog/archive/2005/12/06/1554.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>VB.NET编程日记</title><link>http://www.cppblog.com/edog/archive/2005/12/03/1507.html</link><dc:creator>冰冻热狗</dc:creator><author>冰冻热狗</author><pubDate>Fri, 02 Dec 2005 16:21:00 GMT</pubDate><guid>http://www.cppblog.com/edog/archive/2005/12/03/1507.html</guid><wfw:comment>http://www.cppblog.com/edog/comments/1507.html</wfw:comment><comments>http://www.cppblog.com/edog/archive/2005/12/03/1507.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/edog/comments/commentRss/1507.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/edog/services/trackbacks/1507.html</trackback:ping><description><![CDATA[1、FOR循环的郁闷<BR>VB.NET中的FOR循环中改变了界限的数值，还只是记住原来的界限，考虑以下程序，是把一个字符串中的非字母去掉：<BR>
<DIV style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><SPAN style="COLOR: #008080">&nbsp;1</SPAN><IMG src="http://www.cppblog.com/images/OutliningIndicators/None.gif" align=top><SPAN style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">Dim</SPAN><SPAN style="COLOR: #000000">&nbsp;ss&nbsp;</SPAN><SPAN style="COLOR: #0000ff">As</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">String</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">Gogo&nbsp;No&nbsp;Kocha&nbsp;(Milk&nbsp;Tea)&nbsp;(500ml)&nbsp;-&nbsp;Small</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #008080">&nbsp;2</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.cppblog.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">Dim</SPAN><SPAN style="COLOR: #000000">&nbsp;pos2&nbsp;</SPAN><SPAN style="COLOR: #0000ff">As</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">Integer</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;ss.Length<BR></SPAN><SPAN style="COLOR: #008080">&nbsp;3</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.cppblog.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">Dim</SPAN><SPAN style="COLOR: #000000">&nbsp;i&nbsp;</SPAN><SPAN style="COLOR: #0000ff">As</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">Integer</SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #008080">&nbsp;4</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.cppblog.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">Dim</SPAN><SPAN style="COLOR: #000000">&nbsp;ch&nbsp;</SPAN><SPAN style="COLOR: #0000ff">As</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">Char</SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #008080">&nbsp;5</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.cppblog.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">For</SPAN><SPAN style="COLOR: #000000">&nbsp;i&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">0</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">To</SPAN><SPAN style="COLOR: #000000">&nbsp;pos2&nbsp;</SPAN><SPAN style="COLOR: #000000">-</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">1</SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #008080">&nbsp;6</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.cppblog.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">If</SPAN><SPAN style="COLOR: #000000">&nbsp;i&nbsp;</SPAN><SPAN style="COLOR: #000000">&gt;=</SPAN><SPAN style="COLOR: #000000">&nbsp;pos2&nbsp;</SPAN><SPAN style="COLOR: #000000">-</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">1</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">Then</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">Exit</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">For</SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #008080">&nbsp;7</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.cppblog.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ch&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;ss.Chars(i)<BR></SPAN><SPAN style="COLOR: #008080">&nbsp;8</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.cppblog.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">If</SPAN><SPAN style="COLOR: #000000">&nbsp;ch.IsLetter(ch)&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">False</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">And</SPAN><SPAN style="COLOR: #000000">&nbsp;ch&nbsp;</SPAN><SPAN style="COLOR: #000000">&lt;&gt;</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">Then</SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #008080">&nbsp;9</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.cppblog.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ss&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;ss.Remove(i,&nbsp;</SPAN><SPAN style="COLOR: #000000">1</SPAN><SPAN style="COLOR: #000000">)<BR></SPAN><SPAN style="COLOR: #008080">10</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.cppblog.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;i&nbsp;</SPAN><SPAN style="COLOR: #000000">-=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">1</SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #008080">11</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.cppblog.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;pos2&nbsp;</SPAN><SPAN style="COLOR: #000000">-=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">1</SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #008080">12</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.cppblog.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">End</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">If</SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #008080">13</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.cppblog.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">Next</SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #008080">14</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.cppblog.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ss&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">Gogo&nbsp;No&nbsp;Kocha&nbsp;Milk&nbsp;Tea&nbsp;ml&nbsp;&nbsp;Small</SPAN><SPAN style="COLOR: #000000">"</SPAN></DIV>如果不加上第6行，会死得很惨。<img src ="http://www.cppblog.com/edog/aggbug/1507.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/edog/" target="_blank">冰冻热狗</a> 2005-12-03 00:21 <a href="http://www.cppblog.com/edog/archive/2005/12/03/1507.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>服务端调试 Web Service 的办法【转贴】</title><link>http://www.cppblog.com/edog/archive/2005/11/30/1442.html</link><dc:creator>冰冻热狗</dc:creator><author>冰冻热狗</author><pubDate>Wed, 30 Nov 2005 06:40:00 GMT</pubDate><guid>http://www.cppblog.com/edog/archive/2005/11/30/1442.html</guid><wfw:comment>http://www.cppblog.com/edog/comments/1442.html</wfw:comment><comments>http://www.cppblog.com/edog/archive/2005/11/30/1442.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/edog/comments/commentRss/1442.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/edog/services/trackbacks/1442.html</trackback:ping><description><![CDATA[<P><BR>把本地调试好的服务上传到WEB空间去试试，可以访问，调试看看，恩？“The test form is only available for requests from the local machine”怎么回事，找找，原来是这样。。。<BR><BR>通过编辑 Web 服务所在的 vroot 的 Web.config 文件，可以启用 HTTP GET 和 HTTP POST。以下配置同时启用了 HTTP GET 和 HTTP POST：</P>
<P><FONT color=#ff0000><STRONG>&lt;configuration&gt;<BR>&nbsp;&nbsp;&nbsp; &lt;system.web&gt;<BR>&nbsp;&nbsp;&nbsp; &lt;webServices&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;protocols&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;add name="HttpGet"/&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;add name="HttpPost"/&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/protocols&gt;<BR>&nbsp;&nbsp;&nbsp; &lt;/webServices&gt;<BR>&nbsp;&nbsp;&nbsp; &lt;/system.web&gt;<BR>&lt;/configuration&gt;</STRONG></FONT></P>
<P>或者，可以通过编辑 Machine.config 中的 &lt;protocols&gt; 节为计算机上的所有 Web 服务启用这些协议。下面的示例启用了 HTTP GET、HTTP POST 及 SOAP，此外还从本地主机启用了 HTTP POST： </P>
<P><STRONG><FONT color=#ff0000>&lt;protocols&gt;<BR>&lt;add name="HttpSoap"/&gt;<BR>&lt;add name="HttpPost"/&gt;<BR>&lt;add name="HttpGet"/&gt;<BR>&lt;add name="HttpPostLocalhost"/&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;!-- Documentation enables the documentation/test pages --&gt;<BR>&lt;add name="Documentation"/&gt;<BR>&lt;/protocols&gt;</FONT></STRONG></P><img src ="http://www.cppblog.com/edog/aggbug/1442.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/edog/" target="_blank">冰冻热狗</a> 2005-11-30 14:40 <a href="http://www.cppblog.com/edog/archive/2005/11/30/1442.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>