﻿<?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++博客-捷波的窝-文章分类-WIN32</title><link>http://www.cppblog.com/ljbxc/category/13161.html</link><description /><language>zh-cn</language><lastBuildDate>Sat, 06 Mar 2010 03:34:03 GMT</lastBuildDate><pubDate>Sat, 06 Mar 2010 03:34:03 GMT</pubDate><ttl>60</ttl><item><title>[转] 路径相关API</title><link>http://www.cppblog.com/ljbxc/articles/108716.html</link><dc:creator>捷波</dc:creator><author>捷波</author><pubDate>Tue, 02 Mar 2010 02:51:00 GMT</pubDate><guid>http://www.cppblog.com/ljbxc/articles/108716.html</guid><description><![CDATA[
		<div style="background: none repeat scroll 0% 0% rgb(243, 243, 243); text-indent: 18pt; line-height: 15.75pt;">
				<span style="font-size: 10pt; color: black;">原帖地址：http://randy.host22.com/archives/34<br /><br />      需要头文件：</span>
				<span style="font-size: 10pt; color: black;">shlwapi.h</span>
		</div>
		<div style="background: none repeat scroll 0% 0% rgb(243, 243, 243); text-indent: 18pt; line-height: 15.75pt;">
				<span style="font-size: 10pt; color: black;">其中有一些函数功能存在重复，我在认为比较常用的的函数上加红。</span>
		</div>
		<div style="background: none repeat scroll 0% 0% rgb(243, 243, 243); text-indent: 18pt; line-height: 15.75pt;">
				<span style="font-size: 10pt; color: black;">
				</span>
		</div>
		<div style="background: none repeat scroll 0% 0% rgb(243, 243, 243); text-indent: 18pt; line-height: 15.75pt;">
				<span style="font-size: 10pt; color: black;">
				</span>
		</div>
		<div style="background: none repeat scroll 0% 0% rgb(243, 243, 243); text-indent: 18pt; line-height: 15.75pt;">
				<strong>
						<span style="font-size: 10pt; color: red;">BOOL PathFileExists(LPCTSTR  
lpszPath)</span>
				</strong>
		</div>
		<div style="background: none repeat scroll 0% 0% rgb(243, 243, 243); text-indent: 18pt; line-height: 15.75pt;">
				<span style="font-size: 10pt; color: black;">功能：检查文件</span>
				<span style="font-size: 10pt; color: black;">/</span>
				<span style="font-size: 10pt; color: black;">路径是否存在</span>
		</div>
		<div style="background: none repeat scroll 0% 0% rgb(243, 243, 243); text-indent: 18pt; line-height: 15.75pt;">
				<span style="font-size: 10pt; color: black;">
				</span>
		</div>
		<div style="background: none repeat scroll 0% 0% rgb(243, 243, 243); text-indent: 18pt; line-height: 15.75pt;">
				<span style="font-size: 10pt; color: black;">
				</span>
		</div>
		<div style="background: none repeat scroll 0% 0% rgb(243, 243, 243); text-indent: 18pt; line-height: 15.75pt;">
				<span style="font-size: 10pt; color: black;">
				</span>
		</div>
		<div style="background: none repeat scroll 0% 0% rgb(243, 243, 243); text-indent: 18pt; line-height: 15.75pt;">
				<strong>
						<span style="font-size: 10pt; color: red;">LPTSTR PathFindFileName(LPCTSTR  
pPath)</span>
				</strong>
		</div>
		<div style="background: none repeat scroll 0% 0% rgb(243, 243, 243); text-indent: 18pt; line-height: 15.75pt;">
				<span style="font-size: 10pt; color: black;">功能：获得路径中的文件名</span>
		</div>
		<div style="background: none repeat scroll 0% 0% rgb(243, 243, 243); text-indent: 18pt; line-height: 15.75pt;">
				<span style="font-size: 10pt; color: black;">例如：</span>
				<span style="font-size: 10pt; color: black;"> 
PathFileFileName( “c:\\Program  Files\\File.txt” ) = “File.txt”</span>
				<span style="font-size: 10pt; color: black;">。</span>
		</div>
		<div style="background: none repeat scroll 0% 0% rgb(243, 243, 243); text-indent: 18pt; line-height: 15.75pt;">
				<span style="font-size: 10pt; color: black;">如果路径中不包含文件名，则返回值是最下面的目录名。</span>
		</div>
		<div style="background: none repeat scroll 0% 0% rgb(243, 243, 243); text-indent: 18pt; line-height: 15.75pt;">
				<span style="font-size: 10pt; color: black;">
				</span>
		</div>
		<div style="background: none repeat scroll 0% 0% rgb(243, 243, 243); text-indent: 18pt; line-height: 15.75pt;">
				<span style="font-size: 10pt; color: black;">
				</span>
		</div>
		<div style="background: none repeat scroll 0% 0% rgb(243, 243, 243); text-indent: 18pt; line-height: 15.75pt;">
				<span style="font-size: 10pt; color: black;">
				</span>
		</div>
		<div style="background: none repeat scroll 0% 0% rgb(243, 243, 243); text-indent: 18pt; line-height: 15.75pt;">
				<strong>
						<span style="font-size: 10pt; color: black;">LPTSTR PathFindExtension(LPCTSTR 
 pPath)</span>
				</strong>
		</div>
		<div style="background: none repeat scroll 0% 0% rgb(243, 243, 243); text-indent: 18pt; line-height: 15.75pt;">
				<span style="font-size: 10pt; color: black;">功能：获取路径或文件名中的文件扩展名</span>
		</div>
		<div style="background: none repeat scroll 0% 0% rgb(243, 243, 243); text-indent: 18pt; line-height: 15.75pt;">
				<span style="font-size: 10pt; color: black;">例如：</span>
				<span style="font-size: 10pt; color: black;">PathFindExtension(
 “File.txt” ) =  “.txt”</span>
		</div>
		<div style="background: none repeat scroll 0% 0% rgb(243, 243, 243); text-indent: 18pt; line-height: 15.75pt;">
				<span style="font-size: 10pt; color: black;">
				</span>
		</div>
		<div style="background: none repeat scroll 0% 0% rgb(243, 243, 243); text-indent: 18pt; line-height: 15.75pt;">
				<span style="font-size: 10pt; color: black;">
				</span>
		</div>
		<div style="background: none repeat scroll 0% 0% rgb(243, 243, 243); text-indent: 18pt; line-height: 15.75pt;">
				<span style="font-size: 10pt; color: black;">
				</span>
		</div>
		<div style="background: none repeat scroll 0% 0% rgb(243, 243, 243); text-indent: 18pt; line-height: 15.75pt;">
				<strong>
						<span style="font-size: 10pt; color: black;">LPTSTR 
PathFindNextComponent(LPCTSTR  pszPath)</span>
				</strong>
		</div>
		<div style="background: none repeat scroll 0% 0% rgb(243, 243, 243); text-indent: 18pt; line-height: 15.75pt;">
				<span style="font-size: 10pt; color: black;">例如：</span>
				<span style="font-size: 10pt; color: black;">PathFindNextComponent(
 “c:\\Program  Files\\Directory” ) = “Program Files\\</span>
				<span style="font-size: 10pt; color: black;">Directory”</span>
		</div>
		<div style="background: none repeat scroll 0% 0% rgb(243, 243, 243); text-indent: 18pt; line-height: 15.75pt;">
				<span style="font-size: 10pt; color: black;">PathFindNextComponent( “c:\\Program Files”  ) = “Program 
Files”</span>
		</div>
		<div style="background: none repeat scroll 0% 0% rgb(243, 243, 243); text-indent: 18pt; line-height: 15.75pt;">
				<span style="font-size: 10pt; color: black;">
				</span>
		</div>
		<div style="background: none repeat scroll 0% 0% rgb(243, 243, 243); text-indent: 18pt; line-height: 15.75pt;">
				<span style="font-size: 10pt; color: black;">
				</span>
		</div>
		<div style="background: none repeat scroll 0% 0% rgb(243, 243, 243); text-indent: 18pt; line-height: 15.75pt;">
				<span style="font-size: 10pt; color: black;">
				</span>
		</div>
		<div style="background: none repeat scroll 0% 0% rgb(243, 243, 243); text-indent: 18pt; line-height: 15.75pt;">
				<strong>
						<span style="font-size: 10pt; color: black;">BOOL PathFindOnPath( IN OUT 
LPTSTR pszFile  , IN LPCTSTR * ppszOtherDirs)</span>
				</strong>
		</div>
		<div style="background: none repeat scroll 0% 0% rgb(243, 243, 243); text-indent: 18pt; line-height: 15.75pt;">
				<span style="font-size: 10pt; color: black;">功能：在指定的目录中寻找文件。</span>
		</div>
		<strong>
				<span style="font-size: 10pt; color: black;">参数：</span>
				<strong>
						<span style="font-size: 10pt; color: black;">pszFile</span>
				</strong>
				<span style="font-size: 10pt; color: black;">
				</span>
				<span style="font-size: 10pt; color: black;">要寻找的文件名，确保</span>
				<span style="font-size: 10pt; color: black;"> pszFile </span>
				<span style="font-size: 10pt; color: black;">有足够的大小来容纳</span>
				<span style="font-size: 10pt; color: black;"> 
MAX_PATH </span>
				<span style="font-size: 10pt; color: black;">个字符。如果能找到指定
的文件，该参数将返回文件的全路径。</span>
		</strong>
		<div style="background: none repeat scroll 0% 0% rgb(243, 243, 243); margin-left: 40.05pt; text-indent: -40.05pt; line-height: 15.75pt;">
				<strong>
						<strong>
								<span style="font-size: 10pt; color: black;"> 
ppszOtherDirs</span>
						</strong>
						<span style="font-size: 10pt; color: black;">该参数是首先要寻找的目录列表，它可以为</span>
						<span style="font-size: 10pt; color: black;">NULL</span>
						<span style="font-size: 10pt; color: black;">，如果为</span>
						<span style="font-size: 10pt; color: black;">NULL</span>
						<span style="font-size: 10pt; color: black;">，函数将在系统目录，当前目录和由</span>
						<span style="font-size: 10pt; color: black;">PATH</span>
						<span style="font-size: 10pt; color: black;">设定的目录中查找。</span>
				</strong>
		</div>
		<div style="background: none repeat scroll 0% 0% rgb(243, 243, 243); margin-left: 40.05pt; text-indent: -40.05pt; line-height: 15.75pt;">
				<span style="font-size: 10pt; color: black;">
						<strong>
						</strong>
				</span>
		</div>
		<div style="background: none repeat scroll 0% 0% rgb(243, 243, 243); margin-left: 40.05pt; text-indent: -40.05pt; line-height: 15.75pt;">
				<span style="font-size: 10pt; color: black;">
						<strong>
						</strong>
				</span>
		</div>
		<div style="background: none repeat scroll 0% 0% rgb(243, 243, 243); text-indent: 18pt; line-height: 15.75pt;">
				<strong>
						<strong>
								<span style="font-size: 10pt; color: red;">LPTSTR PathGetArgs(LPCTSTR  
pszPath)</span>
						</strong>
				</strong>
		</div>
		<div style="background: none repeat scroll 0% 0% rgb(243, 243, 243); text-indent: 18pt; line-height: 15.75pt;">
				<span style="font-size: 10pt; color: black;">
						<strong>功能：从路径中分析参数</strong>
				</span>
		</div>
		<div style="background: none repeat scroll 0% 0% rgb(243, 243, 243); text-indent: 18pt; line-height: 15.75pt;">
				<span style="font-size: 10pt; color: black;">
						<strong>例如：</strong>
				</span>
				<span style="font-size: 10pt; color: black;">
						<strong>LPTSTR pszParam = PathGetArgs(  “notepad.exe 
c:\\temp.txt” )</strong>
				</span>
		</div>
		<div style="background: none repeat scroll 0% 0% rgb(243, 243, 243); text-indent: 18pt; line-height: 15.75pt;">
				<span style="font-size: 10pt; color: black;">
						<strong>pszParam </strong>
				</span>
				<span style="font-size: 10pt; color: black;">
						<strong>返回</strong>
				</span>
				<span style="font-size: 10pt; color: black;">
						<strong> “c:\\temp.txt”</strong>
				</span>
		</div>
		<div style="background: none repeat scroll 0% 0% rgb(243, 243, 243); text-indent: 18pt; line-height: 15.75pt;">
				<span style="font-size: 10pt; color: black;">
						<strong>
						</strong>
				</span>
		</div>
		<div style="background: none repeat scroll 0% 0% rgb(243, 243, 243); text-indent: 18pt; line-height: 15.75pt;">
				<strong>
						<strong>
								<span style="font-size: 10pt; color: black;">int PathGetDriveNumber(LPCTSTR  
lpsz)</span>
						</strong>
				</strong>
		</div>
		<div style="background: none repeat scroll 0% 0% rgb(243, 243, 243); text-indent: 18pt; line-height: 15.75pt;">
				<span style="font-size: 10pt; color: black;">
						<strong>功能：从路径中分析盘符</strong>
				</span>
		</div>
		<div style="background: none repeat scroll 0% 0% rgb(243, 243, 243); text-indent: 18pt; line-height: 15.75pt;">
				<span style="font-size: 10pt; color: black;">
						<strong>返回值：成功返回</strong>
				</span>
				<span style="font-size: 10pt; color: black;">
						<strong> 0 –25 </strong>
				</span>
				<span style="font-size: 10pt; color: black;">
						<strong>，代表（</strong>
				</span>
				<span style="font-size: 10pt; color: black;">
						<strong>A – Z</strong>
				</span>
				<span style="font-size: 10pt; color: black;">
						<strong>），失败返回</strong>
				</span>
				<span style="font-size: 10pt; color: black;">
						<strong> –1</strong>
				</span>
		</div>
		<div style="background: none repeat scroll 0% 0% rgb(243, 243, 243); text-indent: 18pt; line-height: 15.75pt;">
				<span style="font-size: 10pt; color: black;">
						<strong>
						</strong>
				</span>
		</div>
		<div style="background: none repeat scroll 0% 0% rgb(243, 243, 243); text-indent: 18pt; line-height: 15.75pt;">
				<span style="font-size: 10pt; color: black;">
						<strong>
						</strong>
				</span>
		</div>
		<div style="background: none repeat scroll 0% 0% rgb(243, 243, 243); text-indent: 18pt; line-height: 15.75pt;">
				<strong>
						<strong>
								<span style="font-size: 10pt; color: black;">BOOL PathIsContentType(LPCTSTR  
pszPath,LPCTSTR pszContentType)</span>
						</strong>
				</strong>
		</div>
		<div style="background: none repeat scroll 0% 0% rgb(243, 243, 243); text-indent: 18pt; line-height: 15.75pt;">
				<span style="font-size: 10pt; color: black;">
						<strong>功能：检查文件是否为指定的</strong>
				</span>
				<strong>
						<strong>
								<span style="font-size: 10pt; color: black;">ContentType</span>
						</strong>
				</strong>
		</div>
		<div style="background: none repeat scroll 0% 0% rgb(243, 243, 243); text-indent: 18pt; line-height: 15.75pt;">
				<span style="font-size: 10pt; color: black;">
						<strong>例如：</strong>
				</span>
				<span style="font-size: 10pt; color: black;">
						<strong>PathIsContentType( “hello.txt” ,  “text/plain” ) </strong>
				</span>
				<span style="font-size: 10pt; color: black;">
						<strong>返回ＴＲＵＥ</strong>
				</span>
		</div>
		<div style="background: none repeat scroll 0% 0% rgb(243, 243, 243); text-indent: 18pt; line-height: 15.75pt;">
				<span style="font-size: 10pt; color: black;">
						<strong>
						</strong>
				</span>
				<span style="font-size: 10pt; color: black;">
						<strong>PathIsContentType( “hello.txt” ,  “image/gif” ) </strong>
				</span>
				<span style="font-size: 10pt; color: black;">
						<strong>返回ＦＡＬＳＥ</strong>
				</span>
		</div>
		<div style="background: none repeat scroll 0% 0% rgb(243, 243, 243); text-indent: 18pt; line-height: 15.75pt;">
				<span style="font-size: 10pt; color: black;">
						<strong>
						</strong>
				</span>
		</div>
		<div style="background: none repeat scroll 0% 0% rgb(243, 243, 243); text-indent: 18pt; line-height: 15.75pt;">
				<span style="font-size: 10pt; color: black;">
						<strong>
						</strong>
				</span>
		</div>
		<div style="background: none repeat scroll 0% 0% rgb(243, 243, 243); text-indent: 18pt; line-height: 15.75pt;">
				<strong>
						<strong>
								<span style="font-size: 10pt; color: black;">BOOL PathIsDirectory(LPCTSTR  
pszPath)</span>
						</strong>
				</strong>
		</div>
		<div style="background: none repeat scroll 0% 0% rgb(243, 243, 243); text-indent: 18pt; line-height: 15.75pt;">
				<span style="font-size: 10pt; color: black;">
						<strong>功能：检查路径是否为有效目录。注意路径不能包含文件名</strong>
				</span>
		</div>
		<div style="background: none repeat scroll 0% 0% rgb(243, 243, 243); text-indent: 18pt; line-height: 15.75pt;">
				<span style="font-size: 10pt; color: black;">
						<strong>
						</strong>
				</span>
		</div>
		<div style="background: none repeat scroll 0% 0% rgb(243, 243, 243); text-indent: 18pt; line-height: 15.75pt;">
				<span style="font-size: 10pt; color: black;">
						<strong>
						</strong>
				</span>
		</div>
		<div style="background: none repeat scroll 0% 0% rgb(243, 243, 243); text-indent: 18pt; line-height: 15.75pt;">
				<strong>
						<strong>
								<span style="font-size: 10pt; color: black;">BOOL PathIsFileSpec(LPCTSTR  
lpszPath)</span>
						</strong>
				</strong>
		</div>
		<div style="background: none repeat scroll 0% 0% rgb(243, 243, 243); text-indent: 18pt; line-height: 15.75pt;">
				<span style="font-size: 10pt; color: black;">
						<strong>功能：检查路径中是否带有</strong>
				</span>
				<span style="font-size: 10pt; color: black;">
						<strong> ‘:’ </strong>
				</span>
				<span style="font-size: 10pt; color: black;">
						<strong>和</strong>
				</span>
				<span style="font-size: 10pt; color: black;">
						<strong> ‘\’ </strong>
				</span>
				<span style="font-size: 10pt; color: black;">
						<strong>分隔符</strong>
				</span>
		</div>
		<div style="background: none repeat scroll 0% 0% rgb(243, 243, 243); text-indent: 18pt; line-height: 15.75pt;">
				<span style="font-size: 10pt; color: black;">
						<strong>
						</strong>
				</span>
		</div>
		<div style="background: none repeat scroll 0% 0% rgb(243, 243, 243); text-indent: 18pt; line-height: 15.75pt;">
				<span style="font-size: 10pt; color: black;">
						<strong>
						</strong>
				</span>
		</div>
		<div style="background: none repeat scroll 0% 0% rgb(243, 243, 243); text-indent: 18pt; line-height: 15.75pt;">
				<strong>
						<strong>
								<span style="font-size: 10pt; color: black;">BOOL PathIsHTMLFile(LPCTSTR  
pszFile)</span>
						</strong>
				</strong>
		</div>
		<div style="background: none repeat scroll 0% 0% rgb(243, 243, 243); text-indent: 18pt; line-height: 15.75pt;">
				<span style="font-size: 10pt; color: black;">
						<strong>功能：检查是否为ＨＴＭＬ文件</strong>
				</span>
		</div>
		<div style="background: none repeat scroll 0% 0% rgb(243, 243, 243); text-indent: 18pt; line-height: 15.75pt;">
				<span style="font-size: 10pt; color: black;">
						<strong>
						</strong>
				</span>
		</div>
		<div style="background: none repeat scroll 0% 0% rgb(243, 243, 243); text-indent: 18pt; line-height: 15.75pt;">
				<span style="font-size: 10pt; color: black;">
						<strong>
						</strong>
				</span>
		</div>
		<div style="background: none repeat scroll 0% 0% rgb(243, 243, 243); text-indent: 18pt; line-height: 15.75pt;">
				<strong>
						<strong>
								<span style="font-size: 10pt; color: black;">BOOL PathIsPrefix(IN LPCTSTR 
pszPrefix,IN  LPCTSTR pszPath)</span>
						</strong>
				</strong>
		</div>
		<div style="background: none repeat scroll 0% 0% rgb(243, 243, 243); text-indent: 18pt; line-height: 15.75pt;">
				<span style="font-size: 10pt; color: black;">
						<strong>功能：检查路径是否包含指定前缀，前缀如：</strong>
				</span>
				<span style="font-size: 10pt; color: black;">
						<strong>”</strong>
				</span>
				<span style="font-size: 10pt; color: black;">
						<strong>盘符</strong>
				</span>
				<span style="font-size: 10pt; color: black;">
						<strong>:\\”</strong>
				</span>
				<span style="font-size: 10pt; color: black;">
						<strong> 、</strong>
				</span>
				<span style="font-size: 10pt; color: black;">
						<strong>“..\\” </strong>
				</span>
				<span style="font-size: 10pt; color: black;">
						<strong>、</strong>
				</span>
				<span style="font-size: 10pt; color: black;">
						<strong>”.\\”</strong>
				</span>
		</div>
		<div style="background: none repeat scroll 0% 0% rgb(243, 243, 243); text-indent: 18pt; line-height: 15.75pt;">
				<span style="font-size: 10pt; color: black;">
						<strong>PathIsPrefix ( “c:\\” , “c:\\hello.txt” ) </strong>
				</span>
				<span style="font-size: 10pt; color: black;">
						<strong>返回</strong>
				</span>
				<span style="font-size: 10pt; color: black;">
						<strong> TRUE</strong>
				</span>
		</div>
		<div style="background: none repeat scroll 0% 0% rgb(243, 243, 243); text-indent: 18pt; line-height: 15.75pt;">
				<span style="font-size: 10pt; color: black;">
						<strong>
						</strong>
				</span>
		</div>
		<div style="background: none repeat scroll 0% 0% rgb(243, 243, 243); text-indent: 18pt; line-height: 15.75pt;">
				<span style="font-size: 10pt; color: black;">
						<strong>
						</strong>
				</span>
		</div>
		<div style="background: none repeat scroll 0% 0% rgb(243, 243, 243); text-indent: 18pt; line-height: 15.75pt;">
				<strong>
						<strong>
								<span style="font-size: 10pt; color: black;">BOOL PathIsRelative(LPCTSTR  
lpszPath)</span>
						</strong>
				</strong>
		</div>
		<div style="background: none repeat scroll 0% 0% rgb(243, 243, 243); text-indent: 18pt; line-height: 15.75pt;">
				<span style="font-size: 10pt; color: black;">
						<strong>功能：检查路径是否是相对路径</strong>
				</span>
		</div>
		<div style="background: none repeat scroll 0% 0% rgb(243, 243, 243); text-indent: 18pt; line-height: 15.75pt;">
				<span style="font-size: 10pt; color: black;">
						<strong>
						</strong>
				</span>
		</div>
		<div style="background: none repeat scroll 0% 0% rgb(243, 243, 243); text-indent: 18pt; line-height: 15.75pt;">
				<span style="font-size: 10pt; color: black;">
						<strong>
						</strong>
				</span>
		</div>
		<div style="background: none repeat scroll 0% 0% rgb(243, 243, 243); text-indent: 18pt; line-height: 15.75pt;">
				<strong>
						<strong>
								<span style="font-size: 10pt; color: black;">BOOL PathIsRoot(LPCTSTR  pPath)</span>
						</strong>
				</strong>
		</div>
		<div style="background: none repeat scroll 0% 0% rgb(243, 243, 243); text-indent: 18pt; line-height: 15.75pt;">
				<span style="font-size: 10pt; color: black;">
						<strong>功能：检查路径是否是根目录</strong>
				</span>
		</div>
		<div style="background: none repeat scroll 0% 0% rgb(243, 243, 243); text-indent: 18pt; line-height: 15.75pt;">
				<span style="font-size: 10pt; color: black;">
						<strong>
						</strong>
				</span>
		</div>
		<div style="background: none repeat scroll 0% 0% rgb(243, 243, 243); text-indent: 18pt; line-height: 15.75pt;">
				<span style="font-size: 10pt; color: black;">
						<strong>
						</strong>
				</span>
		</div>
		<div style="background: none repeat scroll 0% 0% rgb(243, 243, 243); text-indent: 18pt; line-height: 15.75pt;">
				<strong>
						<strong>
								<span style="font-size: 10pt; color: black;">BOOL PathIsSameRoot(LPCTSTR  
pszPath1,LPCTSTR pszPath2);</span>
						</strong>
				</strong>
		</div>
		<div style="background: none repeat scroll 0% 0% rgb(243, 243, 243); text-indent: 18pt; line-height: 15.75pt;">
				<span style="font-size: 10pt; color: black;">
						<strong>功能：比较两个路径是否在同一盘符</strong>
				</span>
		</div>
		<div style="background: none repeat scroll 0% 0% rgb(243, 243, 243); text-indent: 18pt; line-height: 15.75pt;">
				<span style="font-size: 10pt; color: black;">
						<strong>
						</strong>
				</span>
		</div>
		<div style="background: none repeat scroll 0% 0% rgb(243, 243, 243); text-indent: 18pt; line-height: 15.75pt;">
				<span style="font-size: 10pt; color: black;">
						<strong>
						</strong>
				</span>
		</div>
		<div style="background: none repeat scroll 0% 0% rgb(243, 243, 243); text-indent: 18pt; line-height: 15.75pt;">
				<strong>
						<strong>
								<span style="font-size: 10pt; color: black;">BOOL PathIsUNC(LPCTSTR pszPath  
);</span>
						</strong>
				</strong>
		</div>
		<div style="background: none repeat scroll 0% 0% rgb(243, 243, 243); text-indent: 18pt; line-height: 15.75pt;">
				<span style="font-size: 10pt; color: black;">
						<strong>功能：判断路径是否是</strong>
				</span>
				<span style="font-size: 10pt; color: black;">
						<strong>UNC</strong>
				</span>
				<span style="font-size: 10pt; color: black;">
						<strong>格式</strong>
				</span>
		</div>
		<div style="background: none repeat scroll 0% 0% rgb(243, 243, 243); text-indent: 18pt; line-height: 15.75pt;">
				<span style="font-size: 10pt; color: black;">
						<strong>
						</strong>
				</span>
		</div>
		<div style="background: none repeat scroll 0% 0% rgb(243, 243, 243); text-indent: 18pt; line-height: 15.75pt;">
				<span style="font-size: 10pt; color: black;">
						<strong>
						</strong>
				</span>
		</div>
		<div style="background: none repeat scroll 0% 0% rgb(243, 243, 243); text-indent: 18pt; line-height: 15.75pt;">
				<strong>
						<strong>
								<span style="font-size: 10pt; color: red;">BOOL PathIsURL(IN LPCTSTR pszPath  
);</span>
						</strong>
				</strong>
		</div>
		<div style="background: none repeat scroll 0% 0% rgb(243, 243, 243); text-indent: 18pt; line-height: 15.75pt;">
				<span style="font-size: 10pt; color: black;">
						<strong>功能：判断路径是否是</strong>
				</span>
				<span style="font-size: 10pt; color: black;">
						<strong>URL</strong>
				</span>
		</div>
		<div style="background: none repeat scroll 0% 0% rgb(243, 243, 243); text-indent: 18pt; line-height: 15.75pt;">
				<span style="font-size: 10pt; color: black;">
						<strong>
						</strong>
				</span>
		</div>
		<div style="background: none repeat scroll 0% 0% rgb(243, 243, 243); text-indent: 18pt; line-height: 15.75pt;">
				<span style="font-size: 10pt; color: black;">
						<strong>
						</strong>
				</span>
		</div>
		<div style="background: none repeat scroll 0% 0% rgb(243, 243, 243); text-indent: 18pt; line-height: 15.75pt;">
				<strong>
						<strong>
								<span style="font-size: 10pt; color: red;">BOOL </span>
						</strong>
						<strong>
								<span style="font-size: 10pt;">
										<span style="color: rgb(255, 0, 0);">PathMatchSpec</span>
								</span>
						</strong>
						<strong>
								<span style="font-size: 10pt; color: red;">( LPCTSTR pszFileParam,LPCTSTR  
pszSpec)</span>
						</strong>
				</strong>
		</div>
		<div style="background: none repeat scroll 0% 0% rgb(243, 243, 243); text-indent: 18pt; line-height: 15.75pt;">
				<span style="font-size: 10pt; color: black;">
						<strong>功能：用带有通配符（</strong>
				</span>
				<span style="font-size: 10pt; color: black;">
						<strong>*</strong>
				</span>
				<span style="font-size: 10pt; color: black;">
						<strong>号和</strong>
				</span>
				<span style="font-size: 10pt; color: black;">
						<strong>?</strong>
				</span>
				<span style="font-size: 10pt; color: black;">
						<strong>号）的字符串去比较另一个字符串</strong>
				</span>
		</div>
		<div style="background: none repeat scroll 0% 0% rgb(243, 243, 243); text-indent: 18pt; line-height: 15.75pt;">
				<span style="font-size: 10pt; color: black;">
						<strong>例如：</strong>
				</span>
				<strong>
						<strong>
								<span style="font-size: 10pt; background: none repeat scroll 0% 0% rgb(255, 255, 102); color: black;">PathMatchSpec</span>
						</strong>
						<span style="font-size: 10pt; color: black;">( “http://news.sina.com.cn” , 
“*sina.com*”  ) </span>
						<span style="font-size: 10pt; color: black;">返回</span>
						<span style="font-size: 10pt; color: black;">TRUE</span>
				</strong>
		</div>
		<div style="background: none repeat scroll 0% 0% rgb(243, 243, 243); text-indent: 18pt; line-height: 15.75pt;">
				<span style="font-size: 10pt; color: black;">
						<strong>
								<strong>
										<span style="background: none repeat scroll 0% 0% rgb(255, 255, 102);"> PathMatchSpec</span>
								</strong>( 
“c:\\hello.txt” ,  “*.txt” ) </strong>
				</span>
				<span style="font-size: 10pt; color: black;">
						<strong>返回</strong>
				</span>
				<span style="font-size: 10pt; color: black;">
						<strong>TRUE</strong>
				</span>
		</div>
		<div style="background: none repeat scroll 0% 0% rgb(243, 243, 243); text-indent: 18pt; line-height: 15.75pt;">
				<span style="font-size: 10pt; color: black;">
						<strong>
						</strong>
				</span>
		</div>
		<div style="background: none repeat scroll 0% 0% rgb(243, 243, 243); text-indent: 18pt; line-height: 15.75pt;">
				<span style="font-size: 10pt; color: black;">
						<strong>
						</strong>
				</span>
		</div>
		<div style="background: none repeat scroll 0% 0% rgb(243, 243, 243); text-indent: 18pt; line-height: 15.75pt;">
				<strong>
						<strong>
								<span style="font-size: 10pt; color: black;">void PathRemoveArgs(LPTSTR  
pszPath);</span>
						</strong>
				</strong>
		</div>
		<div style="background: none repeat scroll 0% 0% rgb(243, 243, 243); text-indent: 18pt; line-height: 15.75pt;">
				<span style="font-size: 10pt; color: black;">
						<strong>功能：删除路径中带有的参数</strong>
				</span>
		</div>
		<div style="background: none repeat scroll 0% 0% rgb(243, 243, 243); text-indent: 18pt; line-height: 15.75pt;">
				<span style="font-size: 10pt; color: black;">
						<strong>
						</strong>
				</span>
		</div>
		<div style="background: none repeat scroll 0% 0% rgb(243, 243, 243); text-indent: 18pt; line-height: 15.75pt;">
				<span style="font-size: 10pt; color: black;">
						<strong>
						</strong>
				</span>
		</div>
		<div style="background: none repeat scroll 0% 0% rgb(243, 243, 243); text-indent: 18pt; line-height: 15.75pt;">
				<strong>
						<strong>
								<span style="font-size: 10pt; color: black;">LPTSTR PathRemoveBackslash(LPTSTR
  lpszPath);</span>
						</strong>
				</strong>
		</div>
		<div style="background: none repeat scroll 0% 0% rgb(243, 243, 243); text-indent: 18pt; line-height: 15.75pt;">
				<span style="font-size: 10pt; color: black;">
						<strong>功能：删除路径结尾多余的</strong>
				</span>
				<span style="font-size: 10pt; color: black;">
						<strong>’\’</strong>
				</span>
				<span style="font-size: 10pt; color: black;">
						<strong>符号</strong>
				</span>
		</div>
		<div style="background: none repeat scroll 0% 0% rgb(243, 243, 243); text-indent: 18pt; line-height: 15.75pt;">
				<span style="font-size: 10pt; color: black;">
						<strong>
						</strong>
				</span>
		</div>
		<div style="background: none repeat scroll 0% 0% rgb(243, 243, 243); text-indent: 18pt; line-height: 15.75pt;">
				<span style="font-size: 10pt; color: black;">
						<strong>
						</strong>
				</span>
		</div>
		<div style="background: none repeat scroll 0% 0% rgb(243, 243, 243); text-indent: 18pt; line-height: 15.75pt;">
				<strong>
						<strong>
								<span style="font-size: 10pt; color: black;">void PathRemoveBlanks(LPTSTR  
lpszString);</span>
						</strong>
				</strong>
		</div>
		<div style="background: none repeat scroll 0% 0% rgb(243, 243, 243); text-indent: 18pt; line-height: 15.75pt;">
				<span style="font-size: 10pt; color: black;">
						<strong>功能：删除字符串头尾的空格</strong>
				</span>
		</div>
		<div style="background: none repeat scroll 0% 0% rgb(243, 243, 243); text-indent: 18pt; line-height: 15.75pt;">
				<span style="font-size: 10pt; color: black;">
						<strong>
						</strong>
				</span>
		</div>
		<div style="background: none repeat scroll 0% 0% rgb(243, 243, 243); text-indent: 18pt; line-height: 15.75pt;">
				<span style="font-size: 10pt; color: black;">
						<strong>
						</strong>
				</span>
		</div>
		<div style="background: none repeat scroll 0% 0% rgb(243, 243, 243); text-indent: 18pt; line-height: 15.75pt;">
				<strong>
						<strong>
								<span style="font-size: 10pt; color: black;">void PathRemoveExtension( LPTSTR 
 pszPath);</span>
						</strong>
				</strong>
		</div>
		<div style="background: none repeat scroll 0% 0% rgb(243, 243, 243); text-indent: 18pt; line-height: 15.75pt;">
				<span style="font-size: 10pt; color: black;">
						<strong>功能：删除路径后面的文件扩展名</strong>
				</span>
		</div>
		<div style="background: none repeat scroll 0% 0% rgb(243, 243, 243); text-indent: 18pt; line-height: 15.75pt;">
				<span style="font-size: 10pt; color: black;">
						<strong>
						</strong>
				</span>
		</div>
		<div style="background: none repeat scroll 0% 0% rgb(243, 243, 243); text-indent: 18pt; line-height: 15.75pt;">
				<span style="font-size: 10pt; color: black;">
						<strong>
						</strong>
				</span>
		</div>
		<div style="background: none repeat scroll 0% 0% rgb(243, 243, 243); text-indent: 18pt; line-height: 15.75pt;">
				<strong>
						<strong>
								<span style="font-size: 10pt; color: red;">BOOL PathRemoveFileSpec( LPTSTR  
pszPath);</span>
						</strong>
				</strong>
		</div>
		<div style="background: none repeat scroll 0% 0% rgb(243, 243, 243); text-indent: 18pt; line-height: 15.75pt;">
				<span style="font-size: 10pt; color: black;">
						<strong>功能：删除路径后面的文件名和</strong>
				</span>
				<span style="font-size: 10pt; color: black;">
						<strong>’\’</strong>
				</span>
				<span style="font-size: 10pt; color: black;">
						<strong>符号。该函数可以分析出一个文件的路径。</strong>
				</span>
		</div>
		<div style="background: none repeat scroll 0% 0% rgb(243, 243, 243); text-indent: 18pt; line-height: 15.75pt;">
				<span style="font-size: 10pt; color: black;">
						<strong>例：</strong>
				</span>
				<span style="font-size: 10pt; color: black;">
						<strong>szPath = “c:\\windows\\system32\\nt.dll”  ;</strong>
				</span>
		</div>
		<div style="background: none repeat scroll 0% 0% rgb(243, 243, 243); text-indent: 21pt; line-height: 15.75pt;">
				<span style="font-size: 10pt; color: black;">
						<strong> 调用</strong>
				</span>
				<span style="font-size: 10pt; color: black;">
						<strong>PathRemoveFileSpec( szPath ) </strong>
				</span>
				<span style="font-size: 10pt; color: black;">
						<strong>后，</strong>
				</span>
				<span style="font-size: 10pt; color: black;">
						<strong>szPath = 
“c:\\windows\\system32”</strong>
				</span>
		</div>
		<div style="background: none repeat scroll 0% 0% rgb(243, 243, 243); text-indent: 21pt; line-height: 15.75pt;">
				<span style="font-size: 10pt; color: black;">
						<strong>
						</strong>
				</span>
		</div>
		<div style="background: none repeat scroll 0% 0% rgb(243, 243, 243); text-indent: 21pt; line-height: 15.75pt;">
				<span style="font-size: 10pt; color: black;">
						<strong>
						</strong>
				</span>
		</div>
		<div style="background: none repeat scroll 0% 0% rgb(243, 243, 243); text-indent: 18pt; line-height: 15.75pt;">
				<strong>
						<strong>
								<span style="font-size: 10pt; color: black;">BOOL PathRenameExtension( IN OUT 
LPTSTR  pszPath,LPCTSTR pszExt);</span>
						</strong>
				</strong>
		</div>
		<div style="background: none repeat scroll 0% 0% rgb(243, 243, 243); text-indent: 18pt; line-height: 15.75pt;">
				<span style="font-size: 10pt; color: black;">
						<strong>功能：替换路径后面的文件扩展名，如果</strong>
				</span>
				<span style="font-size: 10pt; color: black;">
						<strong>pszPath</strong>
				</span>
				<span style="font-size: 10pt; color: black;">
						<strong>后面不带扩展名，则新的扩展名会被添加上去。</strong>
				</span>
		</div>
		<div style="background: none repeat scroll 0% 0% rgb(243, 243, 243); text-indent: 18pt; line-height: 15.75pt;">
				<span style="font-size: 10pt; color: black;">
						<strong> pszPath   pszPath</strong>
				</span>
				<span style="font-size: 10pt; color: black;">
						<strong>至少需要</strong>
				</span>
				<span style="font-size: 10pt; color: black;">
						<strong>MAX_PATH</strong>
				</span>
				<span style="font-size: 10pt; color: black;">
						<strong>个字符的空间</strong>
				</span>
		</div>
		<div style="background: none repeat scroll 0% 0% rgb(243, 243, 243); text-indent: 18pt; line-height: 15.75pt;">
				<span style="font-size: 10pt; color: black;">
						<strong> pszExt </strong>
				</span>
				<span style="font-size: 10pt; color: black;">
						<strong>新的扩展名，必需包含</strong>
				</span>
				<span style="font-size: 10pt; color: black;">
						<strong> . </strong>
				</span>
				<span style="font-size: 10pt; color: black;">
						<strong>号</strong>
				</span>
		</div>
		<div style="background: none repeat scroll 0% 0% rgb(243, 243, 243); text-indent: 18pt; line-height: 15.75pt;">
				<span style="font-size: 10pt; color: black;">
						<strong>
						</strong>
				</span>
		</div>
		<div style="background: none repeat scroll 0% 0% rgb(243, 243, 243); text-indent: 18pt; line-height: 15.75pt;">
				<span style="font-size: 10pt; color: black;">
						<strong>
						</strong>
				</span>
		</div>
		<div style="background: none repeat scroll 0% 0% rgb(243, 243, 243); text-indent: 18pt; line-height: 15.75pt;">
				<strong>
						<strong>
								<span style="font-size: 10pt; color: red;">void PathStripPath(LPTSTR pszPath  
);</span>
						</strong>
				</strong>
		</div>
		<div style="background: none repeat scroll 0% 0% rgb(243, 243, 243); text-indent: 18pt; line-height: 15.75pt;">
				<span style="font-size: 10pt; color: black;">
						<strong>功能：从路径中分析出文件名</strong>
				</span>
		</div>
		<div style="background: none repeat scroll 0% 0% rgb(243, 243, 243); text-indent: 18pt; line-height: 15.75pt;">
				<span style="font-size: 10pt; color: black;">
						<strong>例：</strong>
				</span>
				<span style="font-size: 10pt; color: black;">
						<strong> PathStripPath( “c:\\test\\hello.txt” )  =&gt; 
hello.txt</strong>
				</span>
		</div>
		<div style="background: none repeat scroll 0% 0% rgb(243, 243, 243); text-indent: 18pt; line-height: 15.75pt;">
				<span style="font-size: 10pt; color: black;">
						<strong>
						</strong>
				</span>
		</div>
		<div style="background: none repeat scroll 0% 0% rgb(243, 243, 243); text-indent: 18pt; line-height: 15.75pt;">
				<span style="font-size: 10pt; color: black;">
						<strong>
						</strong>
				</span>
		</div>
		<div style="background: none repeat scroll 0% 0% rgb(243, 243, 243); text-indent: 18pt; line-height: 15.75pt;">
				<strong>
						<strong>
								<span style="font-size: 10pt; color: black;">BOOL PathStripToRoot( LPTSTR 
szRoot  );</span>
						</strong>
				</strong>
		</div>
		<div style="background: none repeat scroll 0% 0% rgb(243, 243, 243); text-indent: 18pt; line-height: 15.75pt;">
				<span style="font-size: 10pt; color: black;">
						<strong>功能：从路径中分析出盘符</strong>
				</span>
		</div>
		<div style="background: none repeat scroll 0% 0% rgb(243, 243, 243); text-indent: 18pt; line-height: 15.75pt;">
				<span style="font-size: 10pt; color: black;">
						<strong>
						</strong>
				</span>
		</div>
		<div style="background: none repeat scroll 0% 0% rgb(243, 243, 243); text-indent: 18pt; line-height: 15.75pt;">
				<span style="font-size: 10pt; color: black;">
						<strong>
						</strong>
				</span>
		</div>
		<div style="background: none repeat scroll 0% 0% rgb(243, 243, 243); text-indent: 18pt; line-height: 15.75pt;">
				<strong>
						<strong>
								<span style="font-size: 10pt; color: black;">void PathUnquoteSpaces( LPTSTR 
lpsz  );</span>
						</strong>
				</strong>
		</div>
		<div style="background: none repeat scroll 0% 0% rgb(243, 243, 243); text-indent: 18pt; line-height: 15.75pt;">
				<span style="font-size: 10pt; color: black;">
						<strong>功能：从带引号的路径中取出路径</strong>
				</span>
		</div>
		<div style="background: none repeat scroll 0% 0% rgb(243, 243, 243); text-indent: 18pt; line-height: 15.75pt;">
				<span style="font-size: 10pt; color: black;">
						<strong>例：</strong>
				</span>
				<span style="font-size: 10pt; color: black;">
						<strong>szPath = “\”c:\\Program Files\”” </strong>
				</span>
		</div>
		<div style="background: none repeat scroll 0% 0% rgb(243, 243, 243); text-indent: 18pt; line-height: 15.75pt;">
				<span style="font-size: 10pt; color: black;">
						<strong>PathUnquoteSpaces( szPath ) =&gt; szPath =  
“c:\\Program Files”</strong>
				</span>
		</div>
		<div style="background: none repeat scroll 0% 0% rgb(243, 243, 243); text-indent: 18pt; line-height: 15.75pt;">
				<span style="font-size: 10pt; color: black;">
						<strong>
						</strong>
				</span>
		</div>
		<div style="background: none repeat scroll 0% 0% rgb(243, 243, 243); text-indent: 18pt; line-height: 15.75pt;">
				<span style="font-size: 10pt; color: black;">
						<strong>附另一路径相关函数，由</strong>
				</span>
				<span style="font-size: 10pt; color: black;">
						<strong>ImageHlp</strong>
				</span>
				<span style="font-size: 10pt; color: black;">
						<strong>提供</strong>
				</span>
		</div>
		<div style="background: none repeat scroll 0% 0% rgb(243, 243, 243); text-indent: 18pt; line-height: 15.75pt;">
				<span style="font-size: 10pt; color: black;">
						<strong>
						</strong>
				</span>
		</div>
		<div style="background: none repeat scroll 0% 0% rgb(243, 243, 243); text-indent: 18pt; line-height: 15.75pt;">
				<strong>
						<strong>
								<span style="font-size: 10pt; color: black;">BOOL  SearchTreeForFile(</span>
						</strong>
				</strong>
		</div>
		<div style="background: none repeat scroll 0% 0% rgb(243, 243, 243); text-indent: 18pt; line-height: 15.75pt;">
				<strong>
						<strong>
								<span style="font-size: 10pt; color: black;">IN LPSTR RootPath, </span>
						</strong>
				</strong>
		</div>
		<div style="background: none repeat scroll 0% 0% rgb(243, 243, 243); text-indent: 18pt; line-height: 15.75pt;">
				<strong>
						<strong>
								<span style="font-size: 10pt; color: black;">IN LPSTR InputPathName, </span>
						</strong>
				</strong>
		</div>
		<div style="background: none repeat scroll 0% 0% rgb(243, 243, 243); text-indent: 18pt; line-height: 15.75pt;">
				<strong>
						<strong>
								<span style="font-size: 10pt; color: black;">OUT LPSTR OutputPathBuffer </span>
						</strong>
				</strong>
		</div>
		<div style="background: none repeat scroll 0% 0% rgb(243, 243, 243); text-indent: 18pt; line-height: 15.75pt;">
				<strong>
						<strong>
								<span style="font-size: 10pt; color: black;">);</span>
						</strong>
				</strong>
		</div>
		<div style="background: none repeat scroll 0% 0% rgb(243, 243, 243); text-indent: 18pt; line-height: 15.75pt;">
				<span style="font-size: 10pt; color: black;">
						<strong>功能：从指定目录树中寻找文件</strong>
				</span>
		</div>
<img src ="http://www.cppblog.com/ljbxc/aggbug/108716.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/ljbxc/" target="_blank">捷波</a> 2010-03-02 10:51 <a href="http://www.cppblog.com/ljbxc/articles/108716.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>