strcomp!=_T(".") && strcomp!=_T("..")

bioruan 2009-11-20 09:28:34
if(fd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
{
CString strcomp=fd.cFileName;
if(strcomp!=_T(".") && strcomp!=_T(".."))
...........
}

fd是文件结构

strcomp!=_T(".") && strcomp!=_T("..")
是什么意思?想半天也不明白,有"." ".."这样的文件夹吗?
...全文
48 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
feiyangdn 2009-11-20
  • 打赏
  • 举报
回复
. 是当前文件夹
..是上一级文件夹

每一个文件夹下都有.和..
江川 2009-11-20
  • 打赏
  • 举报
回复
点用来标识上级目录,你打开winrar或者很多文件就可以看到,。。代表返回上级目录
此书中有几个常用实例系统 <%@language=vbscript codepage=936 %> <% option explicit response.buffer=true %> <% Dim Rs1__MMColParam Rs1__MMColParam = "False" If (Request("MM_EmptyValue") <> "") Then Rs1__MMColParam = Request("MM_EmptyValue") End If %> <% Dim Rs1 Dim Rs1_numRows Set Rs1 = Server.CreateObject("ADODB.Recordset") Rs1.ActiveConnection = MM_connSoft_STRING Rs1.Source = "SELECT * FROM Soft WHERE Deleted = " + Replace(Rs1__MMColParam, "'", "''") + "" Rs1.CursorType = 0 Rs1.CursorLocation = 2 Rs1.LockType = 1 Rs1.Open() Rs1_numRows = 0 %> <% Dim Repeat1__numRows Dim Repeat1__index Repeat1__numRows = 10 Repeat1__index = 0 Rs1_numRows = Rs1_numRows + Repeat1__numRows %> <% ' *** Recordset Stats, Move To Record, and Go To Record: declare stats variables Dim Rs1_total Dim Rs1_first Dim Rs1_last ' set the record count Rs1_total = Rs1.RecordCount ' set the number of rows displayed on this page If (Rs1_numRows < 0) Then Rs1_numRows = Rs1_total Elseif (Rs1_numRows = 0) Then Rs1_numRows = 1 End If ' set the first and last displayed record Rs1_first = 1 Rs1_last = Rs1_first + Rs1_numRows - 1 ' if we have the correct record count, check the other stats If (Rs1_total <> -1) Then If (Rs1_first > Rs1_total) Then Rs1_first = Rs1_total End If If (Rs1_last > Rs1_total) Then Rs1_last = Rs1_total End If If (Rs1_numRows > Rs1_total) Then Rs1_numRows = Rs1_total End If End If %> <% ' *** Recordset Stats: if we don't know the record count, manually count them If (Rs1_total = -1) Then ' count the total records by iterating through the recordset Rs1_total=0 While (Not Rs1.EOF) Rs1_total = Rs1_total + 1 Rs1.MoveNext Wend ' reset the cursor to the beginning If (Rs1.CursorType > 0) Then Rs1.MoveFirst Else Rs1.Requery End If ' set the number of rows displayed on this page If (Rs1_numRows < 0 Or Rs1_numRows > Rs1_total) Then Rs1_numRows = Rs1_total End If ' set the first and last displayed record Rs1_first = 1 Rs1_last = Rs1_first + Rs1_numRows - 1 If (Rs1_first > Rs1_total) Then Rs1_first = Rs1_total End If If (Rs1_last > Rs1_total) Then Rs1_last = Rs1_total End If End If %> <% Dim MM_paramName %> <% ' *** Move To Record and Go To Record: declare variables Dim MM_rs Dim MM_rsCount Dim MM_size Dim MM_uniqueCol Dim MM_offset Dim MM_atTotal Dim MM_paramIsDefined Dim MM_param Dim MM_index Set MM_rs = Rs1 MM_rsCount = Rs1_total MM_size = Rs1_numRows MM_uniqueCol = "" MM_paramName = "" MM_offset = 0 MM_atTotal = false MM_paramIsDefined = false If (MM_paramName <> "") Then MM_paramIsDefined = (Request.QueryString(MM_paramName) <> "") End If %> <% ' *** Move To Record: handle 'index' or 'offset' parameter if (Not MM_paramIsDefined And MM_rsCount <> 0) then ' use index parameter if defined, otherwise use offset parameter MM_param = Request.QueryString("index") If (MM_param = "") Then MM_param = Request.QueryString("offset") End If If (MM_param <> "") Then MM_offset = Int(MM_param) End If ' if we have a record count, check if we are past the end of the recordset If (MM_rsCount <> -1) Then If (MM_offset >= MM_rsCount Or MM_offset = -1) Then ' past end or move last If ((MM_rsCount Mod MM_size) > 0) Then ' last page not a full repeat region MM_offset = MM_rsCount - (MM_rsCount Mod MM_size) Else MM_offset = MM_rsCount - MM_size End If End If End If ' move the cursor to the selected record MM_index = 0 While ((Not MM_rs.EOF) And (MM_index < MM_offset Or MM_offset = -1)) MM_rs.MoveNext MM_index = MM_index + 1 Wend If (MM_rs.EOF) Then MM_offset = MM_index ' set MM_offset to the last possible record End If End If %> <% ' *** Move To Record: if we dont know the record count, check the display range If (MM_rsCount = -1) Then ' walk to the end of the display range for this page MM_index = MM_offset While (Not MM_rs.EOF And (MM_size < 0 Or MM_index < MM_offset + MM_size)) MM_rs.MoveNext MM_index = MM_index + 1 Wend ' if we walked off the end of the recordset, set MM_rsCount and MM_size If (MM_rs.EOF) Then MM_rsCount = MM_index If (MM_size < 0 Or MM_size > MM_rsCount) Then MM_size = MM_rsCount End If End If ' if we walked off the end, set the offset based on page size If (MM_rs.EOF And Not MM_paramIsDefined) Then If (MM_offset > MM_rsCount - MM_size Or MM_offset = -1) Then If ((MM_rsCount Mod MM_size) > 0) Then MM_offset = MM_rsCount - (MM_rsCount Mod MM_size) Else MM_offset = MM_rsCount - MM_size End If End If End If ' reset the cursor to the beginning If (MM_rs.CursorType > 0) Then MM_rs.MoveFirst Else MM_rs.Requery End If ' move the cursor to the selected record MM_index = 0 While (Not MM_rs.EOF And MM_index < MM_offset) MM_rs.MoveNext MM_index = MM_index + 1 Wend End If %> <% ' *** Move To Record: update recordset stats ' set the first and last displayed record Rs1_first = MM_offset + 1 Rs1_last = MM_offset + MM_size If (MM_rsCount <> -1) Then If (Rs1_first > MM_rsCount) Then Rs1_first = MM_rsCount End If If (Rs1_last > MM_rsCount) Then Rs1_last = MM_rsCount End If End If ' set the boolean used by hide region to check if we are on the last record MM_atTotal = (MM_rsCount <> -1 And MM_offset + MM_size >= MM_rsCount) %> <% ' *** Go To Record and Move To Record: create strings for maintaining URL and Form parameters Dim MM_keepNone Dim MM_keepURL Dim MM_keepForm Dim MM_keepBoth Dim MM_removeList Dim MM_item Dim MM_nextItem ' create the list of parameters which should not be maintained MM_removeList = "&index=" If (MM_paramName <> "") Then MM_removeList = MM_removeList & "&" & MM_paramName & "=" End If MM_keepURL="" MM_keepForm="" MM_keepBoth="" MM_keepNone="" ' add the URL parameters to the MM_keepURL string For Each MM_item In Request.QueryString MM_nextItem = "&" & MM_item & "=" If (InStr(1,MM_removeList,MM_nextItem,1) = 0) Then MM_keepURL = MM_keepURL & MM_nextItem & Server.URLencode(Request.QueryString(MM_item)) End If Next ' add the Form variables to the MM_keepForm string For Each MM_item In Request.Form MM_nextItem = "&" & MM_item & "=" If (InStr(1,MM_removeList,MM_nextItem,1) = 0) Then MM_keepForm = MM_keepForm & MM_nextItem & Server.URLencode(Request.Form(MM_item)) End If Next ' create the Form + URL string and remove the intial '&' from each of the strings MM_keepBoth = MM_keepURL & MM_keepForm If (MM_keepBoth <> "") Then MM_keepBoth = Right(MM_keepBoth, Len(MM_keepBoth) - 1) End If If (MM_keepURL <> "") Then MM_keepURL = Right(MM_keepURL, Len(MM_keepURL) - 1) End If If (MM_keepForm <> "") Then MM_keepForm = Right(MM_keepForm, Len(MM_keepForm) - 1) End If ' a utility function used for adding additional parameters to these strings Function MM_joinChar(firstItem) If (firstItem <> "") Then MM_joinChar = "&" Else MM_joinChar = "" End If End Function %> <% ' *** Move To Record: set the strings for the first, last, next, and previous links Dim MM_keepMove Dim MM_moveParam Dim MM_moveFirst Dim MM_moveLast Dim MM_moveNext Dim MM_movePrev Dim MM_urlStr Dim MM_paramList Dim MM_paramIndex Dim MM_nextParam MM_keepMove = MM_keepBoth MM_moveParam = "index" ' if the page has a repeated region, remove 'offset' from the maintained parameters If (MM_size > 1) Then MM_moveParam = "offset" If (MM_keepMove <> "") Then MM_paramList = Split(MM_keepMove, "&") MM_keepMove = "" For MM_paramIndex = 0 To UBound(MM_paramList) MM_nextParam = Left(MM_paramList(MM_paramIndex), InStr(MM_paramList(MM_paramIndex),"=") - 1) If (StrComp(MM_nextParam,MM_moveParam,1) <> 0) Then MM_keepMove = MM_keepMove & "&" & MM_paramList(MM_paramIndex) End If Next If (MM_keepMove <> "") Then MM_keepMove = Right(MM_keepMove, Len(MM_keepMove) - 1) End If End If End If ' set the strings for the move to links If (MM_keepMove <> "") Then MM_keepMove = Server.HTMLEncode(MM_keepMove) & "&" End If MM_urlStr = Request.ServerVariables("URL") & "?" & MM_keepMove & MM_moveParam & "=" MM_moveFirst = MM_urlStr & "0" MM_moveLast = MM_urlStr & "-1" MM_moveNext = MM_urlStr & CStr(MM_offset + MM_size) If (MM_offset - MM_size < 0) Then MM_movePrev = MM_urlStr & "0" Else MM_movePrev = MM_urlStr & CStr(MM_offset - MM_size) End If %> 软件管理
<strong>上 传 软 件 管 理strong>

<% Dim i i = 1 While ((Repeat1__numRows <> 0) AND (NOT Rs1.EOF)) %> <% i = i + 1 Repeat1__index=Repeat1__index+1 Repeat1__numRows=Repeat1__numRows-1 Rs1.MoveNext() Wend %>
<strong>IDstrong> <strong>软件名称strong> <strong>软件大小strong> <strong>软件类型strong> <strong>授权方式strong> <strong>软件语言strong> <strong>操作strong>
<%= i %> <%=(Rs1.Fields.Item("SoftName").Value)%> <%=(Rs1.Fields.Item("SoftSize").Value)%> <%=(Rs1.Fields.Item("SoftType").Value)%> <%=(Rs1.Fields.Item("CopyrightType").Value)%> <%=(Rs1.Fields.Item("SoftLanguage").Value)%> &Flag=Delete">删除 ">移动到
<% If Not Rs1.EOF Or Not Rs1.BOF Then %>
首页 上一页 下一页 尾页  第 <%=abs(Int(-Rs1_last/10))%>页/共 <%=abs(Int(-Rs1_total/10))%>页 10条记录/页
<% End If ' end Not Rs1.EOF Or NOT Rs1.BOF %>

<% Rs1.Close() Set Rs1 = Nothing %>

16,472

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC相关问题讨论
社区管理员
  • 基础类社区
  • Web++
  • encoderlee
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

        VC/MFC社区版块或许是CSDN最“古老”的版块了,记忆之中,与CSDN的年龄几乎差不多。随着时间的推移,MFC技术渐渐的偏离了开发主流,若干年之后的今天,当我们面对着微软的这个经典之笔,内心充满着敬意,那些曾经的记忆,可以说代表着二十年前曾经的辉煌……
        向经典致敬,或许是老一代程序员内心里面难以释怀的感受。互联网大行其道的今天,我们期待着MFC技术能够恢复其曾经的辉煌,或许这个期待会永远成为一种“梦想”,或许一切皆有可能……
        我们希望这个版块可以很好的适配Web时代,期待更好的互联网技术能够使得MFC技术框架得以重现活力,……

试试用AI创作助手写篇文章吧