/// <summary>
        /*******************************************************
        **方法 名:ReadTextFile
        **输入参数:filepath:文件路径;
        **输出参数:i:读取类型(1:正常;2:文件读取错误;3:文件或路径无效);
        **          filecontent:返回内容
        **返 回 值:逻辑类型参数
        **创 建 人:钱哨
        **创建日期:09-7-9
        **描    述:读取存放在某目录下名称为filepath文件内容。
        *******************************************************/
        public void ReadTextFile(string filepath, out Int16 i, out string filecontent)
        {
            if (File.Exists(filepath))
            {
                try
                {
              StreamReader textreader = new StreamReader(filepath, System.Text.Encoding.Default);
                    filecontent = textreader.ReadToEnd();
                    textreader.Close();
                    i = 1;
                }
                catch
                {
                    i = 2;
                    filecontent = "文件读取错误!";
                }
            }
            else
            {
                i = 0;
                filecontent = "文件或路径无效!";
            }
        }
        /// <summary>
        /*******************************************************
        **方法 名:DirectoryOption
        **输入参数:filepath:文件路径;
        **输出参数:i:读取类型 (0:创建文件夹;1:文件夹删除;2:文件夹移动;3:获取文件夹下面所有的子文件信息)  filecontent:返回内容
        **返 回 值:逻辑类型参数
        **创 建 人:钱哨
        **创建日期:09-7-9
        **描    述:读取存放在某目录下名称为filepath文件内容。
        *******************************************************/
        /// <summary>
        public bool DirectoryOption(string Directorypath, string TargetDirectorypath, Int16 OptionMethord, out string[] filesname)
        {
            bool k = true;
            filesname = null;
            if (Directory.Exists(Directorypath))
            {
                try
                {
                    if (OptionMethord == 0)
                    {
                        //创建文件夹
                        Directory.CreateDirectory(Directorypath);
                    }
                    else if (OptionMethord == 1)
                    {
                        //文件夹删除
                        Directory.Delete(Directorypath, true);
                    }
                    else if (OptionMethord == 2)
                    {
                        //文件夹移动
                        Directory.Move(Directorypath, TargetDirectorypath);
                    }
                    else if (OptionMethord == 3)
                    {
                        //获取文件夹下面所有的子文件信息
                        filesname = Directory.GetFiles(Directorypath);
                    }
                }
                catch
                {
                    k = false;
                }
            }
            else
            {
                Directory.CreateDirectory(Directorypath);
                k = true;
            }
            return k;
        }
    }
}