Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

displaying data on new page

Status
Not open for further replies.

ksbrace

Programmer
May 13, 2000
501
US
Hello,
I am new to asp.net, I am doing some file comparing and I want to display the file info on a new page. what is the syntax to get the data to be displayed on a new page? Thanks in advance!
 
More specifically, I'm trying to convert this to asp.net, but I want a button from another page to do this work and have a display.aspx just display the data. thanks,
Kelly

Code:
<html>
<head>
  <title>Duplicate File Finder</title>
</head>

<body>

<table border=&quot;1&quot;>
<tr>
  <th>Filename</th>
  <th>Exists In Target Folder?</th>
  <th>Same Size?</th>
  <th>Same Created Date?</th>
  <th>Same Modified Date?</th>
</tr>

<%
Dim objFSO
Dim strSourcePath, strTargetPath
Dim objSourceFolder
Dim objFile
Dim objSourceFile, objTargetFile

strSourcePath = Server.MapPath(&quot;folder1&quot;)
strTargetPath = Server.MapPath(&quot;folder2&quot;)

Set objFSO = Server.CreateObject(&quot;Scripting.FileSystemObject&quot;)

Set objSourceFolder = objFSO.GetFolder(strSourcePath)

For Each objFile In objSourceFolder.Files
  Response.Write &quot;<tr>&quot; & vbCrLf
  Response.Write &quot;<td>&quot; & &quot;<a href = &quot; & chr(34) & strSourcePath & &quot;\&quot; & objFile.Name & chr(34) & &quot;>&quot; & objFile.Name & &quot;</a>&quot; & &quot;</td>&quot;

  If objFSO.FileExists(strTargetPath & &quot;\&quot; & objFile.Name) Then
    Response.Write &quot;<td>Yes</td>&quot;

    Set objSourceFile = objFSO.GetFile(strSourcePath & &quot;\&quot; & objFile.Name)
    Set objTargetFile = objFSO.GetFile(strTargetPath & &quot;\&quot; & objFile.Name)

    If objSourceFile.Size = objTargetFile.Size Then
      Response.Write &quot;<td>Yes</td>&quot;
    Else
      Response.Write &quot;<td>No</td>&quot;
    End If

    If objSourceFile.DateCreated = objTargetFile.DateCreated Then
      Response.Write &quot;<td>Yes</td>&quot;
    Else
      Response.Write &quot;<td>No</td>&quot;
    End If

    If objSourceFile.DateLastModified = objTargetFile.DateLastModified Then
      Response.Write &quot;<td>Yes</td>&quot;
    Else
      Response.Write &quot;<td>No</td>&quot;
    End If

    Set objSourceFile = Nothing
    Set objTargetFile = Nothing
  Else
    Response.Write &quot;<td>No</td>&quot;

    ' You can add the blank <td>s if desired
    Response.Write &quot;<td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td>&quot;

    ' For a while I was moving files that didn't exist to the target.
    ' Left as comment in case anyone cares:
    'objFSO.MoveFile strSourcePath & &quot;\&quot; & objFile.Name,
    '  strTargetPath & &quot;\&quot; & objFile.Name
  End If

  Response.Write vbCrLf & &quot;</tr>&quot; & vbCrLf
Next 'objFile

Set objSourceFolder = Nothing
Set objFSO = Nothing
%>

</table>

</body>
</html>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top