Escolar Documentos
Profissional Documentos
Cultura Documentos
7/14/12
7/14/12
7/14/12
WriteLine You can write a line of text at a line number that you specify in a file by using the WriteLine operation. AppendContents You can add text that you specify at the end of a file by using the AppendContents operation. ReadContents You can read the entire contents of a file by using the ReadContents operation.
7/14/12
In this example, you specify the path of a file and write a sentence to it by using the WriteLine operation. Next, you add a sentence to the existing content by using the AppendContents operation. Finally, you read the entire contents of the file by using the ReadContents operation. 7/14/12
output
CopyFile You can copy the specified file to a destination by using the CopyFile operation. GetFiles You can get a list of all the files in a directory that you specify by using the GetFiles operation.
7/14/12
output
In this example, you copy the specified source file to the specified destination by using the CopyFile operation. You also specify the directory path, and you then display the paths of all files in the output window by using the GetFiles operation.
7/14/12
CreateDirectory By using this operation, you can create a directory with a name that you specify at a location that you specify. GetDirectories By using this operation, you can get the paths of all the directories in the directory path that you specify.
7/14/12
output
7/14/12
output
Lets Summarize
Use different properties of the File object. Use different operations of the File object.
7/14/12
Requests a suitable name for a directory from the user, and creates a directory of that name. Downloads a file from the network, and copies it to the new directory. Displays the contents of the downloaded file in the text window. Accepts additional content from the user, and adds it to the file. Displays the final content from the file in the text window.
7/14/12