Feb 8, 2012

How to Open a SCH File With OpenTextFile

,
The "OpenTextFile" Visual Basic function opens a file and reads the data that you can use to calculate output for your readers. An SCH file is a Microsoft Schedule file. The OpenTextFile function imports the data without the formatting codes. You can import the scheduling data using the VB OpenTextFile, which is included with the Visual Basic input and output libraries.


Instructions

    • 1
      Open the Visual Studio VB programming software on your desktop. Open the project file and the source code file you want to use to open the SCH file.
    • 2
      Create a file handler variable for the file class. Add the following code to create the variable:
      var handler = new ActiveXObject("Scripting.FileSystemObject");
    • 3
      Open the SCH file using the "handler" variable. The following code uses the OpenTextFile function to open the file named "myfile.sch":
      file = handler.OpenTextFile("c:\myfile.sch", ForReading);
    • 4
      Read the file content. For instance, the following code reads the first line of the file and outputs the result to the user's screen:
      var input = file.ReadLine();
      document.write (input + "<br />");

0 commentaires to “How to Open a SCH File With OpenTextFile”

Post a Comment

 

HowToYo Copyright © 2011 | Template design by O Pregador | Powered by Blogger Templates