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

نسخة كاملة : ممكن كود فيجوال بيسك نقل ملف وحذف ملف واستبدال ملف والكتابه على ملف
أنت حالياً تتصفح نسخة خفيفة من المنتدى . مشاهدة نسخة كاملة مع جميع الأشكال الجمالية .
ممكن كود فيجوال بيسك  نقل ملف وحذف ملف واستبدال ملف والكتابه على ملف
اوامر ان تكون ملفات داخل رسورس اداة وان تستبدل ملفات داخل كمبيوتر
كود :
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")