示例#1
0
 public static bool IsDirectory(GString Dir)
 {
     if (Directory.Exists(Dir.ToString()))
     {
         return(true);
     }
     return(false);
 }
示例#2
0
 public override Int32    Send(GString s)
 {
     if (this._init)
     {
         Byte [] Message = System.Text.Encoding.ASCII.GetBytes(s.ToString());
         return(this._socket.Send(Message, 0, Message.Length, SocketFlags.None));
     }
     return(0);
 }
示例#3
0
 public static Boolean Rmdir(GString Dir, bool Recursif)
 {
     Boolean test = true;
     try
     {
         Directory.Delete(Dir.ToString(), Recursif);
     }
     catch
     {
         test = false;
     }
     return (test);
 }
示例#4
0
 public static Boolean Rename(GString f1, GString f2)
 {
     Boolean test = true;
     try
     {
         Directory.Move(f1.ToString(), f2.ToString());
     }
     catch
     {
         test = false;
     }
     return (test);
 }
示例#5
0
 public bool Cd(GString Dir)
 {
     bool test = true;
     try
     {
         Directory.SetCurrentDirectory(Dir.ToString());
         this._directory = Directory.GetCurrentDirectory();
     }
     catch
     {
         test = false;
     }
     return (test);
 }
示例#6
0
        public static Boolean  Rename(GString f1, GString f2)
        {
            Boolean test = true;

            try
            {
                Directory.Move(f1.ToString(), f2.ToString());
            }
            catch
            {
                test = false;
            }
            return(test);
        }
示例#7
0
        public static Boolean  Rmdir(GString Dir, bool Recursif)
        {
            Boolean test = true;

            try
            {
                Directory.Delete(Dir.ToString(), Recursif);
            }
            catch
            {
                test = false;
            }
            return(test);
        }
示例#8
0
        public bool         Cd(GString Dir)
        {
            bool test = true;

            try
            {
                Directory.SetCurrentDirectory(Dir.ToString());
                this._directory = Directory.GetCurrentDirectory();
            }
            catch
            {
                test = false;
            }
            return(test);
        }
示例#9
0
 public GFileInfos(GString Dir, GString File)
 {
     this._file = System.IO.Path.Combine(Dir.ToString(), File.ToString());
 }
示例#10
0
 /*public static GFileInfos[] Ls(GString Directory)
 {
     GFileInfos[] list;
     String[] files;
     files = Directory.GetFileSystemEntries(Directory);
     int filecount = files.GetUpperBound(0) + 1;
     int i = 0;
     while (i < filecount)
     {
         list[i] = files[i];
         ++i;
     }
     return (list);
 }*/
 public bool Mkdir(GString Dir)
 {
     bool test = true;
     try
     {
         Directory.CreateDirectory(System.IO.Path.Combine(this._directory.ToString(), Dir.ToString()));
     }
     catch
     {
         test = false;
     }
     return (test);
 }
示例#11
0
 public static void Open(GString Drive)
 {
     mciSendString("open " + Drive.ToString() + ":\\ type cdaudio alias cdaudio", "", 0, 0);
     mciSendString("Set cdaudio door open wait", "", 0, 0);
     mciSendString("close cdaudio", "", 0, 0);
 }
示例#12
0
 public static bool IsDirectory(GString Dir)
 {
     if (Directory.Exists(Dir.ToString()))
         return (true);
     return (false);
 }
示例#13
0
 public GFileInfos(GString Dir, GString File)
 {
     this._file = System.IO.Path.Combine(Dir.ToString(), File.ToString());
 }
示例#14
0
        public bool                 Mkpath(GString Path)
        {
            bool test = true;

            try
            {
                Directory.CreateDirectory(System.IO.Path.Combine(this._directory.ToString(), Path.ToString()));
            }
            catch
            {
                test = false;
            }
            return(test);
        }
 public override Int32 Send(GString s)
 {
     if (this._init)
     {
         Byte [] Message = System.Text.Encoding.ASCII.GetBytes(s.ToString());
         return (this._socket.Send (Message, 0, Message.Length, SocketFlags.None));
     }
     return (0);
 }
示例#16
0
 public static void Close(GString Drive)
 {
     mciSendString("open " + Drive.ToString() + ":\\ type cdaudio alias cdaudio", "", 0, 0);
     mciSendString("Set cdaudio door closed wait", "", 0, 0);
     mciSendString("close cdaudio", "", 0, 0);
 }