Our website is mixed with classic asp files and .net files. Now my task is to find and remove those obsolete asp files which are already replaced by .net files. We have hundreds of asp files. Some of them are still in use, but most of them are not referenced
anymore.
Is there any tool that I can use to retrieve which asp files are not in use anymore? I don't want to use Search and check each of asp file name. That's gonna take ages.
There are not shortcuts, you'll have to upgrade by hand each classic asp. One good news is that you can simplify quite a lot from ASP to ASP.NET as there are completely different technologies.
I have in the past done that job, if I may I would like to recommend to take the asp files and instead of translating to ASP.NET to think what are they doing and create the solution with ASP.NET.
I suppose you could write a program that uses the System.IO classes to collect all the .asp file names and then search your code using the Indexing Service on your server. In other words, you could write your own tool.
Here is some code to get you started:
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
namespace ForForums
{
public class Tools
{
public void LoopThruWebSite(string startDirectory)
{
startDirectory = startDirectory.Trim();
string[] subFolders = System.IO.Directory.GetDirectories(startDirectory);
foreach (string folderName in subFolders)
{
//set-up values
string[] aspFiles = System.IO.Directory.GetFiles(folderName, "*.asp");
//loop through the asp files
foreach (string aspName in aspFiles)
{
}
}
}
}
}
That's what I am thinking. Thank you for your help. But writing code myself is not so reliable. For example, if page A1, A2 A3 were called with A+i where i is a for-loop, then there is little chance to capture these pages in the right way. And I'm also considering
other situations, such as page name is commented out, and page is grabbed from database (luckily we don't use that way)....
I found an article that says "FrontPage 2002 can help you find
unlinked files or
older files".... Has anyone using FrontPage had similiar experience?
For example, if page A1, A2 A3 were called with A+i where i is a for-loop, then there is little chance to capture these pages in the right way.
Huh?
chunyu_ccy
I'm also considering other situations, such as page name is commented out,
You could bring back snippets of code in a report and work through the report manually. Or, maybe there is some clever way to do this programmatically.
chunyu_ccy
page is grabbed from database (luckily we don't use that way)....
What are you going to do after you get all the asp files?
I think he wants them removed from his website. But, that's a great point, he could just add a .old extension to the names of the files, then if an error is thrown during testing, he would just need to remove the .old extension. FInally, after the site is
completely tested by Quality Assurance, or whatever his responible facsimile may be, he could just delete all the .old files (this would be easy since he could just use the typical Windows search for *.old in his website directory.
What are you going to do after you get all the asp files?
I think he wants them removed from his website. But, that's a great point, he could just add a .old extension to the names of the files, then if an error is thrown during testing, he would just need to remove the .old extension. FInally, after the site is
completely tested by Quality Assurance, or whatever his responible facsimile may be, he could just delete all the .old files (this would be easy since he could just use the typical Windows search for *.old in his website directory.
Oh, my bad, I misunderstood your question at first. That actually is the more difficult part, I was thinking she could using Windows Indexing Service to search for the names of the files in her web site directory.
Sorry I didn't explain my question clearly and I was away the whole weekend. My task is to remove/archive those obsolete files which are not in use anymore in our website. We have a folder called \secure\ which includes .asp and other files. Recently its
function was replaced with a new folder written in .NET. But the problem is some of files in \secure\ are still in use (probably 15%) and called by other web pages. I need to clean those 85% old files out from website.
So far I know we have totally more 500 files and 25 subfolders in \secure\. I just don't want to check the files one by one, or click the website link by link. Now there are 3 ways I think I can try:
1) Write my own codes, starting from Homepage and sitemap page, check reference/hyperlink in each page until all pages are checked. Those that never have been referenced or linked are obsolete files (but that'll be complicated and not reliable)
2) Use some tool, such as FrontPage (but as a developer in our company, I have to ask permission from other dept to install Frontpage on my local machine)
3) The is the one I could think last. Rename the folder \secure\, then click the web everywhere, and try to find those broken links.
chunyu_ccy
0 Points
10 Posts
How to find obsolete asp files?
Apr 23, 2008 02:27 AM|LINK
Our website is mixed with classic asp files and .net files. Now my task is to find and remove those obsolete asp files which are already replaced by .net files. We have hundreds of asp files. Some of them are still in use, but most of them are not referenced anymore.
Is there any tool that I can use to retrieve which asp files are not in use anymore? I don't want to use Search and check each of asp file name. That's gonna take ages.
Thanks a lot!
asp
albertpascua...
All-Star
17520 Points
3475 Posts
MVP
Re: How to find obsolete asp files?
Apr 23, 2008 04:27 AM|LINK
There are not shortcuts, you'll have to upgrade by hand each classic asp. One good news is that you can simplify quite a lot from ASP to ASP.NET as there are completely different technologies.
I have in the past done that job, if I may I would like to recommend to take the asp files and instead of translating to ASP.NET to think what are they doing and create the solution with ASP.NET.
Al
My Blog
allanhorwitz
Contributor
2517 Points
623 Posts
Re: How to find obsolete asp files?
Apr 23, 2008 08:10 PM|LINK
I suppose you could write a program that uses the System.IO classes to collect all the .asp file names and then search your code using the Indexing Service on your server. In other words, you could write your own tool.
Here is some code to get you started:
using System; using System.Data; using System.Configuration; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; namespace ForForums { public class Tools { public void LoopThruWebSite(string startDirectory) { startDirectory = startDirectory.Trim(); string[] subFolders = System.IO.Directory.GetDirectories(startDirectory); foreach (string folderName in subFolders) { //set-up values string[] aspFiles = System.IO.Directory.GetFiles(folderName, "*.asp"); //loop through the asp files foreach (string aspName in aspFiles) { } } } } }chunyu_ccy
0 Points
10 Posts
Re: How to find obsolete asp files?
Apr 24, 2008 12:53 AM|LINK
That's what I am thinking. Thank you for your help. But writing code myself is not so reliable. For example, if page A1, A2 A3 were called with A+i where i is a for-loop, then there is little chance to capture these pages in the right way. And I'm also considering other situations, such as page name is commented out, and page is grabbed from database (luckily we don't use that way)....
I found an article that says "FrontPage 2002 can help you find unlinked files or older files".... Has anyone using FrontPage had similiar experience?
asp
allanhorwitz
Contributor
2517 Points
623 Posts
Re: How to find obsolete asp files?
Apr 24, 2008 11:20 AM|LINK
Huh?
You could bring back snippets of code in a report and work through the report manually. Or, maybe there is some clever way to do this programmatically.
One less thing to worry about.
albertpascua...
All-Star
17520 Points
3475 Posts
MVP
Re: How to find obsolete asp files?
Apr 26, 2008 10:07 PM|LINK
What are you going to do after you get all the asp files?
Al
My Blog
allanhorwitz
Contributor
2517 Points
623 Posts
Re: How to find obsolete asp files?
Apr 26, 2008 10:36 PM|LINK
I think he wants them removed from his website. But, that's a great point, he could just add a .old extension to the names of the files, then if an error is thrown during testing, he would just need to remove the .old extension. FInally, after the site is completely tested by Quality Assurance, or whatever his responible facsimile may be, he could just delete all the .old files (this would be easy since he could just use the typical Windows search for *.old in his website directory.
allanhorwitz
Contributor
2517 Points
623 Posts
Re: How to find obsolete asp files?
Apr 26, 2008 10:39 PM|LINK
Oh, my bad, I misunderstood your question at first. That actually is the more difficult part, I was thinking she could using Windows Indexing Service to search for the names of the files in her web site directory.
albertpascua...
All-Star
17520 Points
3475 Posts
MVP
Re: How to find obsolete asp files?
Apr 26, 2008 10:45 PM|LINK
Depending on the size of the website, could be a huge job, better to create a diagram of the whole thing and refactor it in .NET. My modest opinion.
Al
My Blog
chunyu_ccy
0 Points
10 Posts
Re: How to find obsolete asp files?
Apr 28, 2008 01:35 AM|LINK
Sorry I didn't explain my question clearly and I was away the whole weekend. My task is to remove/archive those obsolete files which are not in use anymore in our website. We have a folder called \secure\ which includes .asp and other files. Recently its function was replaced with a new folder written in .NET. But the problem is some of files in \secure\ are still in use (probably 15%) and called by other web pages. I need to clean those 85% old files out from website.
So far I know we have totally more 500 files and 25 subfolders in \secure\. I just don't want to check the files one by one, or click the website link by link. Now there are 3 ways I think I can try:
1) Write my own codes, starting from Homepage and sitemap page, check reference/hyperlink in each page until all pages are checked. Those that never have been referenced or linked are obsolete files (but that'll be complicated and not reliable)
2) Use some tool, such as FrontPage (but as a developer in our company, I have to ask permission from other dept to install Frontpage on my local machine)
3) The is the one I could think last. Rename the folder \secure\, then click the web everywhere, and try to find those broken links.
Last, I am a 'she', not 'he'. :-)