adsense


Showing posts with label ADVANCE VB SCRIPT TEXTSTREAM. Show all posts
Showing posts with label ADVANCE VB SCRIPT TEXTSTREAM. Show all posts

Thursday, 12 November 2015

ADVANCE VB SCRIPT TEXTSTREAM PAGE 111

COMPUTER LANGUAGES HTML,C,C++.JAVA,.NET AND MULTIMEDIA basics and programs click home button




ADVANCE VB SCRIPT TEXTSTREAM





TextStream 



TextStream object helps the developers to work with text 
files seamlessly. Developers can read, write or append 
the contents to the text file using the text stream object. 
Syntax 
TextStream.{property  | method( )} 
Example 
If the above script is saved as HTML and executed in IE, 
we would create a folder with name "Test_Folder". 
<!DOCTYPE html> 
<html> 
<body> 
<script language="vbscript" type="text/vbscript"> 
  
  Dim objFSO 
  Set objFSO = CreateObject("Scripting.FileSystemObject")  
  Dim objTextFile  
  Set objTextFile = objFSO.CreateTextFile("D:\Testfile.txt")  
  objTextFile.Close 
  Const ForAppending = 8 
  Set objTextFile = objFSO.OpenTextFile("D:\Testfile.txt",ForAppending,True) 
  objTextFile.WriteLine "Welcome to VBScript Programming" 
  objTextFile.Close 
  Set objTextFile = Nothing  
  Set objFSO = Nothing  
    
</script> 
</body> 
</html> 
If the above script is saved as HTML and executed in IE, 
it will create a text file in D:\ Drive and append the string specified in the WriteLine Method. 
Welcome to VBScript Programming