Click here to Skip to main content
15,881,870 members
Articles / Programming Languages / C#

Neural Dot Net Pt 11 A Conclusion Of Sorts

Rate me:
Please Sign up or sign in to vote.
3.38/5 (19 votes)
9 Dec 20033 min read 55.8K   5.4K   32  
A neural network library in C#.
using System;
using System.IO;
using System.Security;

namespace SharpUtils
{
	/// <summary>
	/// Summary description for DirectoryDetails.
	/// </summary>
	[Serializable]
	public class DirectoryDetails
	{
		private string strError;
		private bool bError;
		private DirectoryInfo dirInfo;

		/// <summary>
		/// get the current error message
		/// </summary>
		public string ErrorMessage
		{
			get
			{
				return strError;
			}
		}

		public bool Error
		{
			get
			{
				return bError;
			}
		}

		/// <summary>
		/// get the directoryinfo for the current directory
		/// </summary>
		public DirectoryInfo GetDirectoryInfo
		{
			get
			{
				return dirInfo;
			}
		}

		/// <summary>
		/// empty constructor for compatibility with file details
		/// </summary>
		public DirectoryDetails()
		{
		}

		/// <summary>
		/// constructor
		/// </summary>
		/// <param name="strLocation">full path of the directory to get information on</param>
		public DirectoryDetails( string strLocation )
		{
			Open( strLocation );
		}

		/// <summary>
		/// open function for compatability fiel file details
		/// </summary>
		/// <param name="strLocation">direcotry to access</param>
		/// <returns>true on success</returns>
		public bool Open( string strLocation )
		{
			bError = false;
			try
			{
				dirInfo = new DirectoryInfo( strLocation );
			}
			catch( ArgumentNullException argNullExp )
			{
				strError = "Error getting directory information reason " + argNullExp.Message;
				bError = true;
			}
			catch( DirectoryNotFoundException dNFExp )
			{
				strError = "Error getting directory information reason " + dNFExp.Message;
				bError = true;
			}
			catch( SecurityException secExp )
			{
				strError = "Error getting the directory information reason " + secExp.Message;
				bError = true;
			}
			catch( ArgumentException argExp )
			{
				strError = "Error getting the directory information reason " + argExp.Message;
				bError = true;
			}
			catch( PathTooLongException ptlExp )
			{
				strError = "Error getting the directory information reason " + ptlExp.Message;
				bError = true;
			}

			return bError == true?false:true;
		}
	}
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
United Kingdom United Kingdom
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions