Click here to Skip to main content
Email Password   helpLost your password?

Sample Image

Introduction

This is a fully functional file management application with basic searching function provided by Microsoft Indexing Service exposed via HTTP Web service. To unify the approach of file objects presented to UI tier, I follow the design pattern to define an abstract class to imitate the file object returned either from mounted folder or searching result. Using a customized ICollection implementation, DataGrid can use it as data source and list items with paging. In addition, file and folder copying function, email file as attachment and web caching function are included.

Features

Features of this file management application include:

File Management Web Page 1

Figure 1 - File Management Web Page in List View

File Management Web Page 2

Figure 2 - File Management Web Page in Iconic View

Send File as Attachment

Figure 3 - Send File as attachment via SMTP server

Setup

Setup steps are as below:

Design

Define An Abstract Class

As each file or folder object will have certain properties in common, an abstract base class SimpleFileInfoBase is created as below to provide necessary fields when binding with UI elements (e.g. DataGrid):

abstract public class SimpleFileInfoBase
{
    public abstract string Name { get ; }
    public abstract string FullName { get ; }
    public abstract DateTime LastWriteTime { get ; }
    public abstract long Size { get ; }
}

In this class, Name denotes the short name, FullName denotes the full path for the file or folder object. The actual implementation is to derive class FileSystemInfoExtend from SimpleFileInfoBase and it is straight forward, and just wrapping the original FileSystemInfo class is enough.:

public class FileSystemInfoExtend : SimpleFileInfoBase
{
    private FileSystemInfo _file ;

    public FileSystemInfoExtend(FileSystemInfo file)
    {
        _file = file ;
    }

    override public string Name
    {
        get { return _file.Name ; }
    }

    override public string FullName
    {
        get { return _file.FullName ; }
    }

    public bool IsDirectory
    {
        get
        {
             return (_file.Attributes & FileAttributes.Directory)
                 ==FileAttributes.Directory ;
        }
    }

    public string Type
    {
        get { return this.IsDirectory?"Dir":"File" ; }
    }

    override public long Size
    {
        get
        {
              if ( this.IsDirectory )
                return 0L ;
            else
                return ((FileInfo)_file).Length  ;
        }
    }

    override public DateTime LastWriteTime
    {
        get { return _file.LastWriteTime ; }
    }
}

Why I decide to define an abstract class SimpleFileInfoBase first before implementing the actual class is because the searching result item type from indexing service shares the same abstract class SimpleFileInfoBase with folder browsing returned item type FileSystemInfoExtend by deriving class SearchResultItem from it as below:

public class SearchResultItem : SimpleFileInfoBase
{
    private string _Name ;
    private string _FullName ;
    private DateTime _LastWriteTime ;
    private long _Size ;

    // Interface to Indexing Service used OleDb 

    //which returns System.Data.DataSet type object.

    // By consuming the DataRow object, the data can be 

    //transformed before presenting to UI.

    public SearchResultItem(DataRow row)
    {
        _Name=
          row["Filename"]==DBNull.Value?string.Empty:(string)row["Filename"];
        _FullName=
          row["Path"]==DBNull.Value?string.Empty:(string)row["Path"] ;
        _LastWriteTime = 
          row["Write"]==DBNull.Value?DateTime.MinValue:(DateTime)row["Write"];
        _Size = row["Size"]==DBNull.Value?0L:(long)row["Size"] ;
    }

    override public string Name { get {return _Name ; } }
    override public string FullName { get { return _FullName; } }
    override public DateTime LastWriteTime { 
                 get { return _LastWriteTime ; } }
    override public long Size { get { return _Size ; } }

}

As I have use two different ways to list items, folder browsing function using classes from System.IO and searching function using classes from System.Data.OleDb (when accessing Indexing Service), both results shall be factorized as common base class before they are presented to DataGrid as the data source.

The System.IO classes create array of FileSystemInfo type objects when we use them to list files or subfolders from the requested path, for example, in the page WebFolder.aspx:

System.IO.DirectoryInfo CurrentRoot = new DirectoryInfo(this.RootPath);
FileSystemInfo[] files ;

On the other hand, result from Indexing Service using ADO.NET OleDb classes produces items in System.Data.DataTable object, for example:

string connstring = "Provider=MSIDXS;Data Source=" + _Catalog ;
using ( OleDbConnection conn = new OleDbConnection(connstring) )
{
    OleDbDataAdapter DataAdapter = new OleDbDataAdapter(_Query, conn);
    DataSet DataSetSearchResult = new DataSet();
    DataAdapter.Fill(DataSetSearchResult, "SearchResults");
    return DataSetSearchResult  ;
}

After implementing two ICollection classes with collection of items from these two classes, they can share common properties which can be accessed in UI (DataGrid) consistently.

// ICollection implementation for FileSystemInfoExtend items

public class FileSystemInfosExtend : ICollection
{
    private FileSystemInfoExtend[] _files ;
    // ... Other stuffs

}


// ICollection implementation for SearchResultItem items

public class SearchResultItems : ICollection
{
    private ArrayList _SearchResultItems ;
    public SearchResultItems(DataTable ResultDataTable)
    {
        _SearchResultItems = new ArrayList() ;
        _SearchResultItems.Clear() ;
        foreach ( DataRow row in ResultDataTable.Rows )
            _SearchResultItems.Add( new SearchResultItem(row) ) ;
    }
        // ... Other stuffs

}

Class design diagram

Figure 9 - Class design diagram

After we implemented ICollection classes, we can set the data source for the DataGrid to these ICollection class objects, for example:

// In WebFolder.aspx, bind the DataGrid as below

FileSystemInfosExtend FileInfosEx = new FileSystemInfosExtend(files) ;
DataGrid1.DataSource = FileInfosEx ;
DataGrid1.DataBind() ;
// In Search.aspx, bind the DataGrid as below

localhost.FileSearch FileSearcherInst = new localhost.FileSearch() ;
FileSearcherInst.Credentials = System.Net.CredentialCache.DefaultCredentials ;
DataTable results =  FileSearcherInst.Search(RootPath, SearchText).Tables[0] ;
SearchResultItems searchResultItems = new SearchResultItems(results) ;
DataGrid1.DataSource = searchResultItems  ;
DataGrid1.DataBind();

Separate Cases for Requesting Folder and File Item

Obviously, requesting for folder and file item are two different things; they need to be handled separately. Folder request will trigger recursive link to same ASPX page (WebFolder.aspx or WebFolderTNView.aspx) with different request path parameter (Query String Parameter) but file request will be linked to another ASPX page (FileSender.aspx) where file item requested will be handled. To address the two situations, a function is created as below:

protected string FormatLink(object file)
{
    FileSystemInfoExtend FileSystemInfoEx = file as FileSystemInfoExtend ;
    if ( FileSystemInfoEx == null )
        return "" ;

    string FileFullName = Server.UrlEncode(FileSystemInfoEx.FullName) ;

    if ( FileSystemInfoEx.IsDirectory )
       return string.Format("{0}?path={1}"
       , this.Request.Path, FileFullName ) ;
    else
       return string.Format("{0}?file={1}"
       , "FileSender.aspx", FileFullName ) ;
}

This function will be used by the Name column of DataGrid as below:

<ASP:HYPERLINK
Text='<%# DataBinder.Eval(Container, "DataItem.Name") %>'
navigateurl='<%# FormatLink(DataBinder.Eval(Container, "DataItem")) %>'
runat="server">
</ASP:HYPERLINK>

File Item Requested Handler

Actually, the file item handling page is very simple and I am sure making it as an IHttpHandler handler is even better to improve performance. ASPX page derived from IHttpHandler too but provides more than needed service in this case! Here is the listing from the FileSender.aspx source:

private void Page_Load(object sender, System.EventArgs e)
{
    string FileFullPath = string.Format("{0}", Request["file"]) ;
    if ( FileFullPath == "" )
        return ;

    FileInfo fileInfo =  new FileInfo(FileFullPath) ;
    if ( !fileInfo.Exists )
       return ;

    Response.ClearHeaders() ;
    Response.ClearContent() ;

    switch ( fileInfo.Extension.ToLower()  )
    {
        case ".htm" :
        case ".html" :
        case ".asp" :
        case ".aspx" :
        case ".xml":
            goto Send_File;
        case ".txt":
        case ".ini":
        case ".log":
            Response.ContentType = "text/plain" ;
            goto Add_Disposition_Inline;

        case ".jpg":
            Response.ContentType =
             string.Format("image/JPEG;name=\"{0}\"", fileInfo.Name) ;
            goto Add_Disposition_Inline;

        case ".gif":
        case ".png":
        case ".bmp":
            Response.ContentType = string.Format("image/{0};name=\"{1}\""
                , fileInfo.Extension.TrimStart('.')
                , fileInfo.Name) ;
            goto Add_Disposition_Inline;

        case ".tif":
            Response.ContentType =
             string.Format("image/tiff;name=\"{0}\"", fileInfo.Name) ;
            goto Add_Disposition_Inline;

        case ".doc":
            Response.ContentType = "Application/msword";
            goto Add_Disposition_Inline;

        case ".xls":
            Response.ContentType = "Application/x-msexcel";
            goto Add_Disposition_Inline;

        case ".pdf":
            Response.ContentType = "Application/pdf";
            goto Add_Disposition_Inline;

        case ".ppt":
        case ".pps":
            Response.ContentType = "Application/vnd.ms-powerpoint";
            goto Add_Disposition_Inline;

        case ".zip":
            Response.ContentType = "application/x-zip-compressed" ;
            goto Add_Disposition_Attachment;

        // Others as attachment only!

        default:
            goto Add_Disposition_Attachment;
    }


    Add_Disposition_Attachment:
        Response.AppendHeader("Content-Disposition"
          , string.Format("attachment;filename=\"{0}\"", fileInfo.Name)) ;
        goto Send_File;

    Add_Disposition_Inline:
        Response.AppendHeader("Content-Disposition"
          , string.Format("inline;filename=\"{0}\"", fileInfo.Name)) ;
        goto Send_File;

    Send_File:
        try
        {
            Response.WriteFile(FileFullPath) ;
        }
        catch (UnauthorizedAccessException)
        {
            string query = Request.UrlReferrer.Query ;
            int i = query.ToLower().IndexOf("error=") ;
            if ( i > -1 )
            {
                int j = query.IndexOf("&", i) ;
                if ( j > -1 )
                    query = query.Remove(i, j-i+1) ;
                else
                    query = query.Remove(i, query.Length-i) ;
            }

            if ( query == "" )
                query = "?" ;
            else if (!query.EndsWith("&"))
                query += "&" ;

            Response.Redirect( Request.UrlReferrer.LocalPath
                + query
                + string.Format("Error=You are not allow to access file {0}."
                , fileInfo.Name)) ;
       }
}

Iconic View

After all, to view the list as iconic items, we need to get the associated icons first and in page ShowFileIcon.aspx, it will handle icons retrieval and listing is as below:

icon = IconHandler.IconHandler.GetAssociatedIcon(fileinfo.FullName,
                                                                 IconSizeUsed) ;
if ( icon != null )
{
    Response.ContentType = "image/x-icon" ;
    string TempFileName =
       fileinfo.Extension != ""
           ? fileinfo.Name.Replace(fileinfo.Extension,".ico")
           : fileinfo.Name+".ico" ;
    Response.AppendHeader("Content-Disposition"
       , string.Format("inline;filename=\"{0}\"", TempFileName)) ;
    icon.Save(Response.OutputStream) ;
    icon.Dispose() ;
}

The function IconHandler.GetAssociatedIcon() does the hard job to get icon resource for most file types registered in Windows and details are as below:

public enum IconSize : uint
{
    Small = 0x0, //16x16

    Large = 0x1  //32x32

}

public class IconHandler
{
    // Filename - the file name to get icon from

    public static IntPtr GetAssociatedIconHandle(string Filename, IconSize size)
    {
        IntPtr hImgSmall; //the handle to the system image list

        IntPtr hImgLarge; //the handle to the system image list

        SHFILEINFO shinfo = new SHFILEINFO();

        if ( size == IconSize.Small )
            hImgSmall = Win32.SHGetFileInfo(Filename, 0
                , ref shinfo,(uint)Marshal.SizeOf(shinfo)
                , Win32.SHGFI_ICON |Win32.SHGFI_SMALLICON);
        else
            hImgLarge = Win32.SHGetFileInfo(Filename, 0
                , ref shinfo, (uint)Marshal.SizeOf(shinfo)
                , Win32.SHGFI_ICON | Win32.SHGFI_LARGEICON);

        return shinfo.hIcon ;
    }

    // Filename - the file name to get icon from

    public static Icon GetAssociatedIcon(string Filename, IconSize size)
    {
        return Icon.FromHandle(GetAssociatedIconHandle(Filename, size)) ;
    }

}

[StructLayout(LayoutKind.Sequential)]
public struct SHFILEINFO
{
    public IntPtr hIcon;
    public IntPtr iIcon;
    public uint dwAttributes;
    [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 260)]
    public string szDisplayName;
    [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 80)]
    public string szTypeName;
};


internal class Win32
{
    public const uint SHGFI_ICON = 0x100;
    public const uint SHGFI_LARGEICON = 0x0; // 'Large icon

    public const uint SHGFI_SMALLICON = 0x1; // 'Small icon

        [DllImport("shell32.dll", CharSet=CharSet.Unicode)]
    public static extern IntPtr SHGetFileInfo(
        [MarshalAs(UnmanagedType.LPWStr)]  // Use wide chars

        string pszPath
        , uint dwFileAttributes
        , ref SHFILEINFO psfi
        , uint cbSizeFileInfo
        , uint uFlags);
}

It makes use of the Win32 Shell Api functions and no existing Managed class provides such file information for us. So that is the only way to go and hopefully, we can get over it in the coming release of .NET.

File Upload

File upload function is too simple to discuss, just be aware that multiple files can be handled in server codes although I have not changed UI to allow it. Below is the function source:

private void buttonSubmit_ServerClick(object sender, System.EventArgs e)
{
    for(int i = 0; i < Request.Files.Count ; ++i)
    {
       HttpPostedFile file = Request.Files[i] as HttpPostedFile;
       string path = string.Format(@"{0}\{1}"
           , this.RootPath.TrimEnd('\\'), Path.GetFileName(file.FileName)) ;
       file.SaveAs(path) ;
    }

    Response.Redirect(Request.Url.PathAndQuery) ;

}

Email Service

Email service is provided with an wrapper class Email which mainly packages all functions provided by System.Web.Mail. Although implementation is straight forward, some key features are still worth to discuss.

Use Thread Pool to Send Email

I think one of the most ignored features of .NET framework is threading. Actually using threads in .NET is much easier than a lot of people expect. To send email via background thread is a very good candidate for such applicable area and codes for this feature are as below:

//

// In class Email send method

//

public void Send(string sTo, string sFrom, string sSubject
, string sBody, string sCc, string sBcc, bool SendByThreadInPool)
{
    MailMessage mailMessage = new MailMessage();

    // Other stuffs ...


    SmtpMail.SmtpServer = _mailServer ;

    if (!SendByThreadInPool)
    {
        SmtpMail.Send( mailMessage ) ;

        if (this._Logger != null)
        {
            string messageInfo = string.Format(
              "From:{0}\tTo:{1}\tSubject:{2}"
              , mailMessage.From
              , mailMessage.To
              , mailMessage.Subject) ;

            this._Logger.Write(messageInfo
              + " completed successfully.") ;
        }
    }
    else
    {
        // Use Thread pool to give immediate UI response

        if (!ThreadPool.QueueUserWorkItem(new WaitCallback(Start)
               , mailMessage))

            throw new ApplicationException(
              "Cannot queue task to send email.") ;
    }

    // Other stuffs ...

}

//

// In class Email Start method

//

private void Start(object mailMessage)
{
    MailMessage message = mailMessage as MailMessage ;
    if (message != null)
    {
        string messageInfo = string.Format("From:{0}\tTo:{1}\tSubject:{2}"
           , message.From, message.To, message.Subject) ;
        try
        {
            SmtpMail.Send( message  );

            if (this._Logger != null)
                this._Logger.Write(messageInfo + " completed successfully.") ;
        }
        catch(Exception excpt)
        {
            if (this._Logger != null)
            {
               this._Logger.Write(messageInfo + " failed.") ;
               this._Logger.Write(excpt.ToString()) ;
            }
            else
            // Re-throw the exception ;

               throw ;
        }
    }
}

The ThreadPool class is implemented in System.Threading assembly and has a method QueueUserWorkItem which gives us a handy feature to queue our task for processing by threads picked up from the .NET provided system thread pool. To have the function running by thread in the thread pool, we need to create a delegate WaitCallBack and to have the function layout matched with this delegate. The layout of the function required is:

void FunctioName(object state) ;

The method Start of Email class actually conforms this standard and I have passed the MailMessage object to the called function when I queue the batch task.

Logging

When developing the background task program, we need to pay attention to error logging. Obviously, when problem happens, background task which does not have a UI, is not easy to alert user. So make sure to implement a proper logging mechanism with background task. As I want to decouple the logging mechanism from Email class, I define an Interface to indicate how logging is provided as below:

public interface ILogger
{
    void Write(string MessageLine) ;
}

The actual implementation goes to the class FileLogger which simply uses text file to provide logging. But as any class that implements ILogger can do the same job, you can easily extend the application to log information to other data store.

Cache Service

One of the nice features given by ASP.NET is caching and you can specify WebForm to be cached automatically by adding declarative statement in the page source. This is the simplest way to have caching in your ASP.NET application. But to explore the real power of ASP.NET caching feature, you need to do more.

I have defined a class CacheManager to provide caching in my application and implementation is as below:

public class CacheManager
{
    static public FileSystemInfosExtend
             GetFileItems(string CurrentRootPath, bool RefreshCache)
    {
        // Format cache key as FileSystemInfosExtend:{CurrentRootPath}

        string keyName =
             string.Format("FileSystemInfosExtend:{0}",  CurrentRootPath) ;
        if ( RefreshCache || HttpContext.Current.Cache[keyName] == null )
        {
            // Remove previous cached item

            if ( HttpContext.Current.Cache[keyName] != null )
                    HttpContext.Current.Cache.Remove(keyName) ;

            DirectoryInfo CurrentRoot = 
                              new DirectoryInfo(CurrentRootPath) ;
            FileSystemInfo[] files = CurrentRoot.GetFileSystemInfos() ;
            FileSystemInfosExtend FileInfosEx = 
                                new FileSystemInfosExtend(files) ;

            // Create cache item

            HttpContext.Current.Cache.Insert(
                keyName
                , FileInfosEx
                , null
                , DateTime.Now.Add(TimeSpan.FromMinutes(
                    AppSetting.ApplicationCacheTimeOut))
                , Cache.NoSlidingExpiration) ;
        }


        return HttpContext.Current.Cache[keyName] as FileSystemInfosExtend ;
    }
}

You should pay attention to the cache key because, if we want to have multiple application objects cached, we need to define some way to distinguish the objects and retrieve them later. As my application objects are lists of folder items, the logical naming convention shall be the path name of the current folder requested plus the object type which is FileSystemInfosExtend.

I have defined a special parameter RefreshCache to explicitly refresh cache. When Refresh button is pressed, cache will be refreshed by calling the Cache Manager with parameter RefreshCache set to true.

.NET framework FileSystemWatcher component gives us access to the following events:

We can make use this component to refresh the application cache and then user of the application will always have latest copies of folder lists.

File and Folder Copying

The file and folder copying function is implemented with System.IO classes. After selecting files or subfolders on the main file list screen, clicking the COPY button at the bottom of screen, you will see the main File Copying screen at FileCopy.aspx page:

Figure 10 - File(s) copy to destination directory selection

Clicking on the Subfolder link button will bring you to the subfolders of the selected folder and clicking on the selected folder itself will copy the files shown on the top list to it.

Store the Selected Items in ViewState

As I have provided paging in the list of file items screen, when user clicks the checkbox to select some of the items and switch to another page, we need to remember the items selected. Save the selected item list in session state may be the option but I see it is better to store them in VeiwState because this information attaches to this particular page only and shall not make it available to other pages by making the scope larger. This is the basic rule of thumb when considering defining scope of variables in the first lesson of programming.

A method SaveSelectedItemKey and a property SelectedKey is defined in the page code-behind class as below:

// Property to stored selected datagrid 

//key (File/directory item full path) to ViewState

private ArrayList SelectedKey
{
    set
    {
       ViewState["SelectedKey"] = value ;
    }
    get
    {
        if ( ViewState["SelectedKey"] == null )
            return new ArrayList() ;
        else
            return ViewState["SelectedKey"] as ArrayList ;
    }
}


// Method to store datagrid keys to page property SelectedKey

private void SaveSelectedItemKey()
{
    ArrayList arrayList =  this.SelectedKey  ;

    foreach(DataGridItem listItem in this.DataGrid1.Items)
    {
       if (listItem.ItemType == ListItemType.AlternatingItem
            || listItem.ItemType == ListItemType.Item)
       {
            CheckBox selected = listItem.FindControl("Select") as CheckBox ;
            string keyItem = DataGrid1.DataKeys[listItem.ItemIndex] as string ;

            if (selected.Checked && !arrayList.Contains(keyItem))
                arrayList.Add(keyItem) ;

            if (!selected.Checked && arrayList.Contains(keyItem) )
                arrayList.Remove(keyItem) ;
        }
    }

    this.SelectedKey = arrayList ;
}

As you can see the CheckBox items will be checked and all the selected DataKey will be stored in the ArrayList that is to be retrieved later when Copy button is clicked to kick-off copying.

Copying the Subfolder Tree

Copying list of files is easy but not so for directory with tree of subdirectories under it. Any help? There is a Move method in System.IO.Directory class to help us to move directory tree but no Copy method is found!

So for us, the poor guys need to develop the function ourselves. Fortunately, it is not difficult with bunch of System.IO classes helping us to achieve the task. Following list of codes is how I do it in a single method:

private int CopyFile(string SourceFile, string DestinationPath)
{
    int FileCount = 0 ;
    // Is SourceFile file or folder(directory) name?

    if (File.Exists(SourceFile))
    {
        File.Copy(SourceFile
            , DestinationPath
            + Path.DirectorySeparatorChar
            + Path.GetFileName(SourceFile)
            , true) ;
            ++FileCount ;
    }
    else if (Directory.Exists(SourceFile))
    {
        // Create the detsination sub-folder(subdirectory) first

        DirectoryInfo directoryInfo  = new DirectoryInfo(SourceFile) ;
        string DestinationSubDirectory = DestinationPath
              + Path.DirectorySeparatorChar
              +  directoryInfo.Name ;

        if (!Directory.Exists(DestinationSubDirectory))
                Directory.CreateDirectory(DestinationSubDirectory) ;

        // Copy all items under this folder(directory)

        //  to detsination sub-folder(subdirectory)

        FileSystemInfo[] fileinfos = directoryInfo.GetFileSystemInfos() ;
        foreach(FileSystemInfo fileinfo in fileinfos)
                FileCount += 
                   this.CopyFile(fileinfo.FullName, DestinationSubDirectory) ;
     }
     else
       throw new System.IO.FileNotFoundException("File not found!", SourceFile) ;

    return FileCount ;
}

The key point to this CopyFile method implementation is to use recursive calls to achieve copying of subdirectories. When source is not a file, the program will list all the items beneath it and create the necessary destination subdirectories before proceeding to call recursively the function.

Other Goodies

Conclusion

There is a long way to go before we can have more features for this file management application. I hope when I have time, will add more functions like move and delete or file items, automatic Application Cache updating by using events from FileSystemWatcher and other advanced features like file versioning. Anyway, I hope this is the start and anyone can help me to make it perfect, based on my rudimentary work is welcomed.

You must Sign In to use this message board.
 
 
Per page   
 FirstPrevNext
GeneralProblem with searching
ajit devasia
9:54 27 Apr '09  
what is the line that has to be added at hte top in filesearcher.cs ,the web service soemthing one.
Questiondelete functionality
Kambiz128
5:35 2 Oct '08  
Excellent code, but it is missing delete functionality. How do u add this feature? Let me know
GeneralCannot Open at Visual Studio 2005
fung
17:32 20 Feb '08  
When i open "filemanagement", the visual c# project file, it need to do conversion. but i always occur error on it. Would anyone know how do fix it?? Thanks!!

The following is conversion result:

"""

This report shows the steps taken to convert your Web application from ASP.NET 1.1 to ASP.NET 2.0.
There may be some unresolved conversion issues you will need to manually fix.
For more information, please refer to http://go.microsoft.com/fwlink/?LinkId=46995 or search for the help topic "Converting from Visual Studio .NET 2002 or 2003".
Conversion Started on project file filemanagement.csproj at February 21 2008, 11:29:24.

=========================ERRORS===================
ERROR: The following files were not migrated because they were not found in the project file or the associated 'BuildAction' is set to 'None'.
You may need to exclude these files from the project after the conversion process in order to compile your web site:
File List == utility.cs,test.aspx,ucfolderlist.ascx,ucfolderlist.ascx.cs.

=========================WARNINGS=================
Warning: This web project was converted as a file-based web application. If your site contained any IIS meta-information, e.g. sub-folders marked as virtual directories, it is recommended that you close this web site and re-open it using the Open Web Site command and selecting the Local IIS tab.

=========================COMMENTS=================
Web.Config: Added 'xhtmlConformance' attribute.
Web.Config: added a reference for assembly System.Design.
Web.Config: added a reference for assembly System.Windows.Forms.
Added folder Web References\filemanagement\localhost.
Moved file Web References\localhost\FileSearcher.disco to the Web References\filemanagement\localhost\ directory.
Moved file Web References\localhost\FileSearcher.wsdl to the Web References\filemanagement\localhost\ directory.
Warning: Renamed file Web References\localhost\Reference.map to file FileSearcher.discomap.
Moved file Web References\localhost\FileSearcher.discomap to the Web References\filemanagement\localhost\ directory.
Removed attribute autoeventwireup from file FileCopy.aspx.
Removed attribute codebehind from file FileCopy.aspx.
Warning: Access level of 'Page_Load' changed to 'protected' in file FileCopy.aspx.cs (Line 38).
'Reference' tag with reference to '~/UCMainMenu.ascx' added to file FileCopy.aspx.
Warning: Access level of 'ButtonHome_Click' changed to 'protected' in file FileCopy.aspx.cs (Line 98).
Warning: Access level of 'ButtonUp1Level_Click' changed to 'protected' in file FileCopy.aspx.cs (Line 104).
Warning: Access level of 'DataGrid1_SelectedIndexChanged' changed to 'protected' in file FileCopy.aspx.cs (Line 126).
Warning: Access level of 'ButtonCancel_Click' changed to 'protected' in file FileCopy.aspx.cs (Line 182).
Removed attribute AutoEventWireup from file FileSender.aspx.
Removed attribute Codebehind from file FileSender.aspx.
Warning: Access level of 'Page_Load' changed to 'protected' in file FileSender.aspx.cs (Line 20).
Removed attribute TargetSchema from file footer.ascx.
Removed attribute Codebehind from file footer.ascx.
Removed attribute AutoEventWireup from file footer.ascx.
Warning: Access level of 'Page_Load' changed to 'protected' in file footer.ascx.cs (Line 16).
Removed attribute Codebehind from file Global.asax.
Removed attribute targetschema from file header.ascx.
Removed attribute codebehind from file header.ascx.
Removed attribute autoeventwireup from file header.ascx.
Warning: Access level of 'Page_Load' changed to 'protected' in file header.ascx.cs (Line 16).
Removed attribute autoeventwireup from file Search.aspx.
Removed attribute codebehind from file Search.aspx.
Warning: Access level of 'Page_Load' changed to 'protected' in file Search.aspx.cs (Line 23).
'Reference' tag with reference to '~/UCMainMenu.ascx' added to file Search.aspx.
Warning: Access level of 'ButtonSearch_Click' changed to 'protected' in file Search.aspx.cs (Line 58).
Removed attribute autoeventwireup from file SendMail.aspx.
Removed attribute codebehind from file SendMail.aspx.
Warning: Access level of 'Page_Load' changed to 'protected' in file SendMail.aspx.cs (Line 47).
'Reference' tag with reference to '~/UCMainMenu.ascx' added to file SendMail.aspx.
Warning: Access level of 'Submit1_ServerClick' changed to 'protected' in file SendMail.aspx.cs (Line 88).
Removed attribute AutoEventWireup from file ShowFileIcon.aspx.
Removed attribute Codebehind from file ShowFileIcon.aspx.
Warning: Access level of 'Page_Load' changed to 'protected' in file ShowFileIcon.aspx.cs (Line 19).
Removed attribute AutoEventWireup from file ShowItem.aspx.
Removed attribute Codebehind from file ShowItem.aspx.
Warning: Access level of 'Page_Load' changed to 'protected' in file ShowItem.aspx.cs (Line 22).
Removed attribute targetschema from file UCMainMenu.ascx.
Removed attribute codebehind from file UCMainMenu.ascx.
Removed attribute autoeventwireup from file UCMainMenu.ascx.
Warning: Access level of 'Page_Load' changed to 'protected' in file UCMainMenu.ascx.cs (Line 41).
Removed attribute targetSchema from file UCShowItem.ascx.
Removed attribute Codebehind from file UCShowItem.ascx.
Removed attribute AutoEventWireup from file UCShowItem.ascx.
Warning: Access level of 'Page_Load' changed to 'protected' in file UCShowItem.ascx.cs (Line 15).
Removed attribute autoeventwireup from file WebFolder.aspx.
Removed attribute codebehind from file WebFolder.aspx.
Warning: Access level of 'Page_Load' changed to 'protected' in file WebFolder.aspx.cs (Line 63).
'Reference' tag with reference to '~/UCMainMenu.ascx' added to file WebFolder.aspx.
Warning: Access level of 'buttonFileUpload_ServerClick' changed to 'protected' in file WebFolder.aspx.cs (Line 184).
Warning: Access level of 'ButtonRefresh_ServerClick' changed to 'protected' in file WebFolder.aspx.cs (Line 197).
Warning: Access level of 'ButtonCopy_Click' changed to 'protected' in file WebFolder.aspx.cs (Line 204).
Removed attribute autoeventwireup from file WebFolderTNView.aspx.
Removed attribute codebehind from file WebFolderTNView.aspx.
Warning: Access level of 'Page_Load' changed to 'protected' in file WebFolderTNView.aspx.cs (Line 40).
'Reference' tag with reference to '~/UCMainMenu.ascx' added to file WebFolderTNView.aspx.
Added folder App_Code.
Moved file SearchResultItems.cs to the App_Code\ directory.
Moved file ILogger.cs to the App_Code\ directory.
Moved file Global.asax.cs to the App_Code\ directory.
Moved file Email.cs to the App_Code\ directory.
Moved file CacheManager.cs to the App_Code\ directory.
Moved file AppSetting.cs to the App_Code\ directory.
Moved file WebUI.cs to the App_Code\ directory.
Moved file FileLogger.cs to the App_Code\ directory.
Moved file FileInfosExtend.cs to the App_Code\ directory.
Warning: Access level of 'IconHandler.Win32' changed to 'public' in file IconHandler.cs (Line 55).
Moved file IconHandler.cs to the App_Code\ directory.
Moved file AssemblyInfo.cs to the App_Code\ directory.
Moved file WebUtility.cs to the App_Code\ directory.
Warning: Renamed folder Web References\ to App_WebReferences.
Changed HTML validation schema for all projects to 'Internet Explorer 6.0'.
Removed file Bin\filemanagement.dll.
Removed file filemanagement.csproj.
Removed file filemanagement.csproj.webinfo.
Project filemanagement.csproj has been converted successfully at February 21 2008, 11:29:28.

"""
Generaltext data to sql query proplem
subathral
21:29 12 Oct '07  
hai friends If i execute the query with single code the data can't inserted to database (ex: eventid=1,eventmessage='Event can't display')
from above query eventmessage field has error due to single code within the data please send a proper solution to this......
GeneralError in search.aspx page.
Pramodkumar goud
5:51 9 Apr '07  
Error occurred! System.Web.Services.Protocols.SoapException: Server was unable to process request. --> The 'MSIDXS.1' provider is not registered on the local machine. --> No error information available: REGDB_E_CLASSNOTREG(0x80040154). at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall) at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters) at filemanagement.localhost.FileSearch.Search(String RootPath, String TextToSearch) in D:\pramod\ASPNetFileManagement_src\ASPNetFileManagement_src\filemanagement\Web References\localhost\Reference.cs:line 37 at filemanagement.Search.BindGrid() in d:\pramod\aspnetfilemanagement_src\aspnetfilemanagement_src\filemanagement\search.aspx.cs:line 93





Error is near the search function passing rootpath and freetext

if i run the web service i am getting "Registry access not allowed"



Thanks,
Pramod

GeneralHow to upload a file into a network folder through Web
Magary_Chen
3:03 28 Nov '06  
Dear,

Could your share the experience about web allplication:

How to upload a file into a network folder?

How to send a mail with attach file that store at network folder?

Best Regards.

Magary
GeneralErr: Value cannot be null. Parameter name: path
ho vang
19:20 3 Sep '06  
-------
Line 23:
Line 24:
Line 25: DirectoryInfo CurrentRoot = new DirectoryInfo(CurrentRootPath) ; Line 26: FileSystemInfo[] files = CurrentRoot.GetFileSystemInfos() ;
Line 27: FileSystemInfosExtend FileInfosEx = new FileSystemInfosExtend(files) ;
--------
Line 25: run (F5):-->
Server Error in '/filemanagement' Application Value cannot be null. Parameter name: path
it's "CurrentRootPath"
why? "CurrentRootPath" == "NUll" when "debug"

QuestionDid this project get done?
toLucky
23:31 23 Aug '06  
It says in the text, that delete is missing. Did this and other stuff get implemented... And if.. Where can I find it?


Copyright - The source code is her, but is it free to use?


I get a few errors:
Could not load type 'UCFolderList'.------\ASPNetFileManagement_src\filemanagement\UCFolderList.ascx

Could not load file or assembly 'Microsoft.Web.UI.WebControls' or one of its dependencies. The system cannot find the file specified.------\ASPNetFileManagement_src\filemanagement\UCFolderList.ascx

Unknown server tag 'iewc:TreeView'.------\ASPNetFileManagement_src\filemanagement\UCFolderList.ascx





Just someone

GeneralRe: Did this project get done?
murliace
8:18 16 Jan '08  
Even i am getting the same errors. How to overcome this ?

Murli Manohar J M
Tenth Planet Technologies
www.tenth-planet.com
email@:jehanmohan.murlimanohar@tenth-planet.com

Generalhelp
ntkurupt
10:57 18 Jul '06  
Hey i dont know where ur file mamangement system files r located and i dont know from where i run it plz tell me how this thing starts me start the setup after that nothing happens i dont know where to fine it out i shall be very grateful if u let me know how to start this

Nabeel Tariq
GeneralI am getting target invocation exception.
Gowtham Sen
3:09 21 Mar '06  
Hi,
I have read your article. It is so good. I have one problem regarding mail sending through asp.net using c#.
While I am doing, I am getting an error message as "Exception was thrown by target of invocation." Some times I am getting as "Could not able to access CDO.message object." How can I solve this. Could you please help me.
I write the code as follows.

MailMessage msg;
msg = new MailMessage();
msg.To = "mailTo@abc.com";
msg.Subject = txtMailSubject.Text;
msg.From ="from@abc.com";
msg.Body= txtMailBody.Text;
msg.Priority = MailPriority.Normal;
msg.Headers.Add("abc","abc Departnment");
SmtpMail.SmtpServer=(string)ConfigurationSettings.AppSettings["SmtpServer"];
// here I am using my smtp server as localhost.
SmtpMail.Send(msg);

Thanks and Regards



Gowtham Sen
GeneralRe: I am getting target invocation exception.
syemhusa
5:00 25 May '06  
You have to see the exception.InnerException.Message, but most probably this is blocking either by your firewall or antivirus.

With Regards,
Syed Murtaza Hussain Rizvi
GeneralWon't install
mishau
12:08 12 Dec '05  
hello, God sees I tried to install it... Sigh
Unfortunatelly, in the very beginning she says she won't, because of "The specified path http://computername/FileManagement is unavailable".Confused She balks as soon as she spits out that message.Frown And now I have no means to change the installation flow. I'm trapped, it's a deadlock. Cry I'd appreciate if I could have an opportunity to install her manually, by copying files into a virtual directory or so.Smile

Thank you!Smile
GeneralTranslate into VB
padierna
11:48 21 Nov '05  
Great job, I'm trying to translate into vb, but there's a lot of troubles, any suggestions?
GeneralRe: Translate into VB
easton
15:18 29 Nov '05  
yeah, use C#
GeneralRun Time Error
rgattinoni
8:18 6 Sep '05  
When I try using the FileManagement Application (eg. http://localhost/FileManagement) I get a run-time error saying that:

Impossibile trovare il metodo Void System.Web.UI.WebControls.BaseDataList.set_Caption(System.String).

which means "unable to find the method Void System.Web.UI.WebControls.BaseDataList.set_Caption (System.String)"

What is missing? I run Setup.exe with no errors.
GeneralRe: Run Time Error
Yuen Chiu So
17:38 7 Sep '05  
Please try to install dotnet version 1.1 service patch 1 and try again setup.
Generalabout the download
aDaNGaDiNG
1:05 27 Jun '05  
Response.WriteFile(filepath);
is not fit to download large file
and MSDN article NO 812406
gives a good supply.
U'd better update Ur article


www.i5baby.com
GeneralRe: about the download
mbkasi
22:47 19 Jul '05  
Hi,
I try with MS article NO 812406. It appends the HTML source code of my download.aspx file as well when I try to download pure TXT file.

Strange!!!!!!

Any one help on this Smile
Thanks.

Generaldelete files?
flokatze
22:58 26 Apr '05  
Great work!
But how can I delete files? A "workflow"-description would be ok.
Thanks


Last Updated 17 Feb 2005 | Advertise | Privacy | Terms of Use | Copyright © CodeProject, 1999-2010