منتدى فيجوال بيسك لكل العرب | منتدى المبرمجين العرب

نسخة كاملة : بعض اوامر التعامل مع الملفات في vb.net
أنت حالياً تتصفح نسخة خفيفة من المنتدى . مشاهدة نسخة كاملة مع جميع الأشكال الجمالية .
كاتب الموضوع : جهاد العريقي

هذة بعض اومر التعامل مع الملفات


كود :
Dim objFile As System.IO.File
' Check for existence of a file
Dim blnExists As Boolean
blnExists = objFile.Exists("c:\unlikely.txt")
' Delete a file
objFile.Delete("c:\goodbye.txt")
' Copy a file
objFile.Copy("c:\source.txt", "e:\destination.txt")
' Move a file
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)
' Check a file creation date
Dim datCreated As DateTime
datCreated = objFile.GetCreationTime("c:\created.txt")