منتدى فيجوال بيسك لكل العرب | منتدى المبرمجين العرب
بعض اوامر التعامل مع الملفات في vb.net - نسخة قابلة للطباعة

+- منتدى فيجوال بيسك لكل العرب | منتدى المبرمجين العرب (http://vb4arb.com/vb)
+-- قسم : قسم لغة الفيجوال بيسك VB.NET (http://vb4arb.com/vb/forumdisplay.php?fid=182)
+--- قسم : قسم مقالات VB.NET (http://vb4arb.com/vb/forumdisplay.php?fid=184)
+--- الموضوع : بعض اوامر التعامل مع الملفات في vb.net (/showthread.php?tid=4937)



بعض اوامر التعامل مع الملفات في vb.net - RaggiTech - 03-10-12

كاتب الموضوع : جهاد العريقي

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


كود :
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")