Saturday, May 9, 2020
VBScript IP File Lab Essay Sample free essay sample
AimIn this lab. students will complete the undermentioned points. * Create a VBScript plan using NotePad++ .* Write a planar cluster of IP delivers to a book document. * Read the IP Addresses content record into a book.* Append new Room/PC/IP reference informations to the content file.* Use the item Scripting. FileSystemObject. Component K Network Connections For this lab. we will just require to connection to vlab-PC1. The processing machine vlab-PC1 is the registering machine on the left side while vlab-PC2 is on the right. In the event that you leave the pointer on the Personal PC symbol for a couple of moments. a device tip message will look bespeaking the hostname of the Personal PC. Open vlab-PC1 and sign in as Administrator with the watchword. Lab OverviewWe are venturing out to get down our lab with the equivalent planar cluster of IP references. As opposed to getting to this variety of IP reference using the room and figuring machine list esteems. We will compose a custom paper test on VBScript IP File Lab Essay Sample or on the other hand any comparable theme explicitly for you Don't WasteYour Time Recruit WRITER Just 13.90/page we are going to make the exhibit out of IP delivers to a Text document named IP_Addresses. csv where each line of the document will consolidate the Comma Separated Values ( CSV ) for room # . registering machine # . IP_Address. We will so form a different VBScript plan that will add on four new lines of informations that will represent the four registering machines in the new room 106 to the IP_Addresses. csv document. Last. we will open and read the newly affixed IP_Addresses. csv and uncover it substance in a significant way. Note: All picking up controls must be content onlyââ¬DO NOT catch the NotePad++ application window or the offer brief window. Use transcript and glue of content just. Undertaking 1: Download and Open IP_ArrayFile_start. vbs in NotePad++ * Open NotePad++ and from the bill of toll. decision File/Open. Open the fileIP_File_start. vbs in the C: Scripts index. On the off chance that you do non see this document. you can download it and pull out it from the eCollege Doc Sharing record IP_File_start. nothing. * Modify the Programmer Header varying and Save As the VBScript document as IP_FileWrite. vbs. * The line diminish ipAddress ( 5. 3 ) announce 6?4 planar exhibit. The 5 and 3 give the maximal record esteem. Since lists ever start at 0. this is a 6?4 exhibit. * The lines that follow initialise the cluster areas with IP references. The principal record ( 0. . 5 ) speaks to the suites 100 through 105. The second list ( 0. . 3 ) speak to the four figuring machines in each room. * The IP reference of the third figuring machine in room 104 can be found in the exhibit segment or constituent ipAddress ( 4. 2 ) . This worth is ââ¬Å"192. 168. 10. 45â⬠. Take a gander at the cluster cautiously to discover the hugeness of the file esteems. Note: If you have to transfer a document into the C: Scripts registry on vlab-PC1 or download a record from the vlab-PC1 C: Scripts record. loosened Windows Explorer ( E ) . As should be obvious on the right. your nearby processing machine pushes ( in this occasion. the C: and D: ) are mapped to enroll transcript and glue ( or impeding power and dot ) simple to help through. Undertaking 2: Add the Code to Write the Array Data to a FilePseudocode| Comments|Specify the undermentioned constantsREAD = 1. Compose = 2. Annex = 8. ASCII = 0Define the variable filename and initialise it to ââ¬Å"IP_Addresses. csvâ⬠Define the variable ipAddrStr and initialise it to ââ¬Å"â⬠Set fso to the ââ¬Å"ScriptingFileSystemObjectâ⬠using CreateObject Set ipFileObj = fso. CreateTextFile ( record name. Valid. ASCII ) For room = 0 to 5 For registering machine = 0 to 3 ipAddrStr = CStr ( room+100 ) A ; ââ¬Å" . â⬠A ; CStr ( computer+1 ) A ; ââ¬Å" . â⬠A ; ipAddress ( room. processing machine ) A ; vbCrLf Use ipFileObj to Write ( IpAddrStr ) NextNext Close the fileSet ipFileObj = fso. OpenTextFile ( filename. Peruse. ASCII ) WScript. Reverberation ipFileObj. ReadAllipFileObj. Close | Named invariables ought to be all tops and the Const prefix ought to be utilized to recognize it from a variable whose worth can adjust. filename is a variable that contains the name of the document we will form. ipAddrStr will be utilized in this way to hive away single records that we will make to the document ââ¬Å"C: ScriptsIP_Addresses. csvâ⬠. You ever need to use ââ¬Å"ScriptingFileSystemObjectâ⬠to peruse. create. or on the other hand affix documents. The CreateTextFile technique has one required proclamation and two discretionary explanations. The primary explanation esteem is the document name as twine constant or variable. The announcement set to True offices we will over-compose the record on the off chance that it exists. The third articulation indicates the textfile group - 1=Unicode. 0=ASCII. 1= framework default design. Note the use of the variable record name. Once ipFileObj is connected to a document. it tends to be utilized only like WScript. StdOut. You can use the Write ( ) . WriteLine ( ) . furthermore, WriteBlankLines ( ) techniques. Settled For cringles are utilized to dish the planar exhibit of IP references. The outside cringle indicates the room 0. . 5 ( stand foring suites 100. . 105 ) and within cringle determines the figuring machine 0. . 3 ( stand foring registering machines 1. . 4 ) . In the a respectable starting point on balls through the cringle when room = 0 and figuring machine = 0. ipAddrStr is set to the valueâ⬠100. 1. 192. 168. 10. 11â⬠. Close the IP_Addresses. csv record using ipFileObj. Close Here we are opening the IP_Addresses. csv document and presenting its substance to check the File Creation and information group. . | Add the codification demonstrated by the pseudocode appeared underneath to create the Array to a book record. Genuine codification and identifiers for factors and strategies inside the pseudocode will be in intense wellspring. Deliberately read the comments to one side of the pseudocodewill be in italics. * Save your arrangement with S. * Press and enter cscript FileWrite. vbs. Snap OK to get down your book run. Your book will run in a docked Console window in NotePad++ as demonstrated as follows. * Another alternative for running this arrangement is to open a Windows Command Prompt ( CLI ) . adjustment registry to the C: Scripts envelope and show the arrangement to come ining the offer cscript IP_FileWrite. vbs. * Execute the dir * . csv offer to check the being of the IP_Addresses. csv document. * If your count has any missteps or your document does non join the informations appeared previously. investigate your arrangement and re-run it until you have the correct outcomes. At the point when you have accomplished the correct results. transcript and paste your IP_FileWrite. vbs plan from NotePad++ into the predetermined textbox in your lab-report papers. Other than duplicate the Windows offer brief count and document affirmation into the predetermined textbox into your lab-report papers. | Undertaking 3: Make the IP_AppendRead. vbs Plan The IP_AppendRead. vbs plan will make informations for another stay with four figuring machines with doled out IP references. The arrangement will add on these four records ( one for every IP reference ) to the IP_Addresses. csv record. At that point the arrangement will open the IP_Addresses. csv document and uncover the substance of the document in a 1 record for every line engaging arrangement. The new room records that were added ought to be shown. * Open NotePad++ and make another document called IP_AppendRead. vbs. Rescue this new book document in the C: Scripts catalog. Do non duplicate and paste any codification from your IP_WriteFile. vbs plan. This arrangement ought to be composed from scraped spot. * Add the codification demonstrated by the pseudocode appeared underneath to add on the new room informations to IP_Addresses. csv. Genuine codification and identifiers for factors and strategies inside the pseudocode will be in striking wellspring. Painstakingly read the comments to one side of the pseudocode ; they will be in italics. Pseudocode| Comments|Add a proper coder heading Determine the undermentioned constantsREAD = 1. Compose = 2. Affix = 8. ASCII =0Define the variable filename and initialise it to ââ¬Å"IP_Addresses. csvâ⬠Define the variable ipAddrStr and initialise it to ââ¬Å"â⬠Define newRoom and introductory it to ââ¬Å"106â⬠Define comp1_IP and initialise it to ââ¬Å"192. 168. 10. 59â⬠Define comp2_IP and initialise it to ââ¬Å"192. 168. 10. 60â⬠Define comp3_IP and initialise it to ââ¬Å"192. 168. 10. 61â⬠Define comp4_IP and initialise it to ââ¬Å"192. 168. 10. 62â⬠Set fso to the item ââ¬Å"Scripting. FileSystemObjectâ⬠| Named invariables ought to be all tops and the const prefix ought to be utilized to recognize it from a variable whose worth can change. filename is a variable that contains the name of the record we will create. ipAddrStr will be utilized to build the record twine that will be kept in touch with the document ââ¬Å"C: ScriptsIP_Addresses. csvâ⬠. The factors newRoom. comp1_IP. comp2_IP. comp3_IP. also, comp4_IP are set to values that speak to another room ( 106 ) that contains four figuring machines with explicit IP references. Utilize the CreateObject ( ) technique to Set fso as an object of type: ââ¬Å"Scripting. FileSystemObjectâ⬠. | Pseudocode| Comments| ipAddrStr = _ newRoom A ; ââ¬Å" . 1. â⬠A ; comp1_IP A ; vbCrLf A ; _ newRoom A ; ââ¬Å" . 2. â⬠A ; comp2_IP A ; vbCrLf A ; _ newRoom A ; ââ¬Å" . 3. â⬠A ; comp3_IP A ; vbCrLf A ; _ newRoom A ; ââ¬Å" . 4. â⬠A ; comp4_IP A ; vbCrLfIf document distinguished by filename does non be Then Beep Speaker Twice Show Message:ââ¬Å"File Does Not Exist! ! ! â⬠A ; newline A ; ââ¬Å"You Must Create the File Before You can Read the File! ! â⬠Quit ProgramEnd IfSet File object ipFileObj using fso. OpenTextFile ( ) make certain document is set APPEND and ASCII group Use ipFileObj article to add on ipAddrStr to stop of the record recognized by fileNameClose the file| ipAddrStr is set to a worth that speaks to the four Personal PCs in the new room 106. Note the utilization of the
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.