FileSystem.FileOpen(11, Application.StartupPath + @"\Welcome.zxm", OpenMode.Random, OpenAccess.Default, OpenShare.Default, -1);                FileSystem.FileGet(11, ref strAllow, (long)1, false);
                FileSystem.FileClose(11);
                FreezerStuff.WinWidth = 640;
                FreezerStuff.WinHeight = 480;FileOpen 和 FileGet 在C#中有对应的函数吗?

解决方案 »

  1.   

    public static void FileOpen (
    int FileNumber,
    string FileName,
    OpenMode Mode,
    [OptionalAttribute] OpenAccess Access,
    [OptionalAttribute] OpenShare Share,
    [OptionalAttribute] int RecordLength
    )public static void FileGet (
    int FileNumber,
    ref bool Value,
    [OptionalAttribute] long RecordNumber
    )
      

  2.   

    // Open an existing file, or create a new one.
            FileInfo fi = new FileInfo("temp.txt");        // Open the file just specified such that no one else can use it.
            FileStream fs = fi.Open( FileMode.OpenOrCreate, FileAccess.ReadWrite, FileShare.None );        // Create another reference to the same file.
            FileInfo nextfi = new FileInfo("temp.txt");                try 
            {
                // Try opening the same file, which was locked by the previous process.
                nextfi.Open( FileMode.OpenOrCreate, FileAccess.Read );            Console.WriteLine("The file was not locked, and was opened by a second process.");
            } 
            catch (IOException) 
            {
                Console.WriteLine("The file could not be opened because it was locked by another process.");
            } 
            catch (Exception e) 
            {
                Console.WriteLine(e.ToString());
            }        // Close the file so it can be deleted.
            fs.Close();
      

  3.   

    添加引用“Microsoft.VisualBasic”然后可以直接在C#里使用VB.net里的函数Microsoft.VisualBasic.FileSystem.FileOpen(...
    Microsoft.VisualBasic.FileSystem.FileGet(...