problem trying to create a simple class
Hi all,
I'm getting an error message when I try to run the following class. The error message is:
"object reference not set to an instance of an object." This error message is referring to variable "a" below when I try to increment it in the "for" statement "a++". Any suggestions would be very much appreciated. Thanks.
Mike
using System;
using System.IO;
namespace HEIAN_TRANSFER
{
///
/// Summary description for HeianFiles.
/// This returns an array of file names in a specific folder.
///
public class HeianFiles
{
private string[] pathNames;
private string[] theFile;
public string[] fileNames;
public HeianFiles()
{
}
public string[] GetFiles(string thePath)
{
int spot;
pathNames = Directory.GetFiles(thePath);
int nbrFiles = pathNames.Length;
for(int a=0;a