الفريق العربي للبرمجةأرشيف المنتديات · 2000 – 2023
نسخة أرشيفية للقراءة فقط — التسجيل والمشاركة مغلقان، والمحتوى محفوظ كما كان.

كود لفتح او تشغيل ملف فيديو من اسطوانة

بدأه طه محمد حامد في 15 يوليو 2011 · 3 رد · 739 مشاهدة · في قواعد بيانات Microsoft Access
مشاركة: واتساب X فيسبوك تيليجرام
#1 صاحب الموضوع

اريد كود لفتح او تشغيل ملف فيديو من اسطوانة

وذلك مثل اسطوانات تفسير الشعراوي مثلا عندما اريد تشغيل ملف ما من علي ال cd يعطي رسالة ادخل الاسطوانة رقم 4

هل هو يحفظ المسار كما في برامج الصور ثم تشغيلها بمجرد النقر علي اسم الملف؟

ام هناك كود آخر

ملحوظة:

هل يجدي في هذا الموضوع الارتباط التشعبي؟

تشغيل ملف فيديو من اسطوانة.rar

Toty_Retos

(المبرمج الصغير)

#2

ضع هذا الكود فى النموذج

      Private Declare Function GetDriveType Lib "kernel32" Alias "GetDriveTypeA" (ByVal nDrive As String) As Long
    Private Declare Function GetLogicalDriveStrings Lib "kernel32" Alias "GetLogicalDriveStringsA" (ByVal nBufferLength As Long, ByVal lpBuffer As String) As Long
    Const DRIVE_CDROM = 5

   Private Function GetFirstCdRomDriveLetter() As String

      ' Declare variables.
      Dim lDriveType As Long
      Dim strDrive As String
      Dim lStart As Long: lStart = 1

      ' Create a string to hold the logical drives.
      Dim strDrives As String
      strDrives = Space(150)

      ' Get the logial drives on the system.
      ' If the function fails it returns zero.
      Dim lRetVal As Long
      lRetVal = GetLogicalDriveStrings(150, strDrives)

      ' Check to see if GetLogicalDriveStrings() worked.
      If lRetVal = 0 Then

         ' Get GetLogicalDriveStrings() failed.
         GetFirstCdRomDriveLetter = vbNullString
         Exit Function
      End If

      ' Get the string that represents the first drive.
      strDrive = Mid(strDrives, lStart, 3)

      Do

         ' Test the first drive.
         lDriveType = GetDriveType(strDrive)

         ' Check if the drive type is a CD-ROM.
         If lDriveType = DRIVE_CDROM Then

            ' Found the first CD-ROM drive on the system.
            GetFirstCdRomDriveLetter = strDrive
            Exit Function
         End If

         ' Increment lStart to next drive in the string.
         lStart = lStart + 4

         ' Get the string that represents the first drive.
         strDrive = Mid(strDrives, lStart, 3)

      Loop While (Mid(strDrives, lStart, 1) <> vbNullChar)

   End Function

Private Sub Serial_name_DblClick(Cancel As Integer)

    On Error Resume Next
    Dim result As String, fldr As String
    'fldr = CurrentProject.Path & "\cd4\"
    fldr = GetFirstCdRomDriveLetter()

    result = Dir(fldr & Me.Serial_name & ".flv", vbNormal)
    If Err.Number = 52 Then
        MsgBox "No CD in CD ROM"
    Else
        If result = "" Then
        MsgBox "No files found."
    Else
        ExecuteFile fldr & Me.Serial_name & ".flv"
        End If
    End If

End Sub

و ضع هذا الكود فى وحدة نمطية

Option Explicit


Public Const SW_SHOWNORMAL As Long = 1

Public Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" _
  (ByVal hWnd As Long, ByVal lpOperation As String, ByVal lpFile As String, _
  ByVal lpParameters As String, ByVal lpDirectory As String, _
  ByVal nShowCmd As Long) As Long

Function ExecuteFile(fileName As String)
  ShellExecute 0, "open", fileName, vbNullString, "", SW_SHOWNORMAL
End Function

لكن لاحظ أننا وضعنا امتداد الملف على انه فلاش

و ان الملف موجود مباشرة على الاسطوانة

تم تعديل هذه المشاركة بواسطة Abo_Yossof في 15 يوليو 2011 في 23:21

مدونتى:-

احترف الأكسس مع أبو يوسف

متغيب حاليا لانشغالى الشديد

#3

يعطيني رسالةno cd in cd rom

Toty_Retos

(المبرمج الصغير)

#4

هل وضعت الاسطوانة بالجهاز

مدونتى:-

احترف الأكسس مع أبو يوسف

متغيب حاليا لانشغالى الشديد

مواضيع مشابهة

عدد الزوار حالياً

المتواجدون خلال آخر دقيقتين · يتحدّث كل ٣٠ ثانية

—الإجمالي—أعضاء مسجّلون—زوار بدون تسجيل

جارٍ التحقق من المتواجدين…