14-10-20, 03:06 AM
14-10-20, 07:17 PM
كود :
Dim objFile As System.IO.File
'معرفة امتداد ملف
Dim blnExists As Boolean
blnExists = objFile.Exists("c:\unlikely.txt")
' حذف ملف
objFile.Delete("c:\goodbye.txt")
' نسخ ملف
objFile.Copy("c:\source.txt", "e:\destination.txt")
' نقل ملف
objFile.Move("c:\oldlocation.txt", "e:\newlocation.txt")
' Check whether a file is read-only
Dim blnReadOnly As Boolean
blnReadOnly = CType(objFile.GetAttributes("c:\readonly.txt").ReadOnly, Boolean)
' Check whether a file is hidden
Dim blnHidden As Boolean
blnHidden = CType(objFile.GetAttributes("c:\hidden.txt").Hidden, Boolean)
' معرفة تاريخ انشاء الملف
Dim datCreated As DateTime
datCreated = objFile.GetCreationTime("c:\created.txt")
كود :
'اعادة تسمية مجلد
My.Computer.FileSystem.RenameDirectory("C:\Test", "SecondTest")
'اعادة تسميه ملف
My.Computer.FileSystem.RenameFile("C:\Test.txt", "SecondTest.txt")