Comp230 Week 6 Ilab

2801 Words12 Pages
Student Name | David Vargas Jr. | Class | COMP230 | Date | 08/13/15 | VBScript IP File Report In the space provided below, copy and paste your IP_FileWrite.vbs program sourcecode. If it doesn’t fit, use the next page for the continuation of your program sourcecode. ' VBScript: IP_FileWrite.vbs ' Written by: David Vargas Jr. ' Date: 08/13/15 ' Class: COMP230 ' Professor: Elizabeth Gasko ' =================================== ' This initializes a 2-dimension array ' of IP Address. The first index +100 ' is the room# and the second index+1 ' is the computer# in the room. dim ipAddress(5,3) ipAddress(0,0)="192.168.10.11" ipAddress(0,1)="192.168.10.12" ipAddress(0,2)="192.168.10.13"…show more content…
'constants Const READ = 1, WRITE = 2, APPend = 8, ASCII = 0 'Define the variables fileName and initialize it fileName = "C:\comp230\IP_Addresses.csv" 'Declare and Set fso to the "ScriptingFileSystemObject" using CreateObject Dim fso Set fso = CreateObject("Scripting.FileSystemObject") 'Define the variables ipAddrStr and initailize it to "" ipAddrStr = "" 'Create an object that works with file Set ipFileObj = fso.CreateTextFile(filename,True,ASCII) For room = 0 to 5 For computer = 0 to 3 ipAddrStr = CStr(room+100) & "," & CStr(computer+1) & "," &_ ipAddress(room,computer) ipFileObj.WriteLine(ipAddrStr) Next Next 'Close the file ipFileObj.Close Set ipFileObj =

    More about Comp230 Week 6 Ilab

      Open Document