تقييم الموضوع :
  • 0 أصوات - بمعدل 0
  • 1
  • 2
  • 3
  • 4
  • 5
ايجاد ملف
#4
الشاكي لله كتب :شكلك سويت كوبي وبست بدون ماتغير شي

PHP كود :
Private Sub Form1_Load(sender As ObjectAs EventArgs)
    
Dim path As String ""
    
Dim folderPath As String Environment.GetEnvironmentVariable("ProgramFiles(x86)")
    
Dim temp As New DirectoryInfo(folderPath)

    
path SearchFile(temp"chrome.exe")
    
MessageBox.Show(path)
End Sub


Private Function SearchFile(SearchDir As DirectoryInfosearchFileName As String) As String
      on error resume next
    Dim temp 
As String ""
    
For Each file As FileInfo In SearchDir.GetFiles(searchFileNameSearchOption.AllDirectories)
        If 
file.Name searchFileName Then
            
Return file.FullName
        End 
If
    
Next

    
Return temp
End 
Function 

مهم : عليك استخدام on error resume next

عشان مايطلع لك خطأ Access to the path is denied > اذا بتشغل البرنامج بمسؤول مارح يطلع لك
شكرآ اخى لاكن الان لا يظر شيء
الرد }}}
تم الشكر بواسطة:


الردود في هذا الموضوع
ايجاد ملف - بواسطة أسامة_mybb_import9019 - 03-08-13, 10:38 AM
ايجاد ملف - بواسطة AHMED HUSSIEN - 03-08-13, 11:29 AM
ايجاد ملف - بواسطة الشاكي لله_mybb_import4784 - 03-08-13, 11:34 AM
ايجاد ملف - بواسطة أسامة_mybb_import9019 - 03-08-13, 03:07 PM
ايجاد ملف - بواسطة أسامة_mybb_import9019 - 03-08-13, 03:12 PM
ايجاد ملف - بواسطة الشاكي لله_mybb_import4784 - 03-08-13, 03:52 PM


التنقل السريع :


يقوم بقرائة الموضوع: