تقييم الموضوع :
  • 0 أصوات - بمعدل 0
  • 1
  • 2
  • 3
  • 4
  • 5
[مشروع] مساعدة في مشروع برنامج يفك تشفير الفيديو المسجل من رسيفر لتشغيلها على الحاسب
#11
(06-11-17, 03:44 PM)سعود الشامان كتب : اضافة الى ما ذكره اخوي silverlight


https://youtu.be/2K4mrj5aI4c

والله هذا الشرح الي بدي ياه يسلمو بارك الله فيك

(06-11-17, 12:07 PM)silverlight كتب : ما أتوقعه هو انك تقوم باستدعاء Process معينة و تقوم بتشغيلها
أتمني يكون توقعاتي صحيحة
في تلك الحالة يجب أن تتعامل مع الكلاس ProcessStartInfo


PHP كود :
Dim pi As ProcessStartInfo = New ProcessStartInfo 

ولإخفاء نافذة الأوامر
يكفي أن تكتب الكود كالتالي


PHP كود :
pi.CreateNoWindow True 
مثال بسيط علي كيفية التعامل مع Command Line Window
المثال يوضح كيفية تمرير أوامر CMD و القراءة من Command Line لكي تحصل علي نتائج معينة


PHP كود :
   Private Function GetDetailsCore(currentProcess As Processfunc As Func(Of ProcessString)) As String
        Return func
(currentProcess)
 
   End Function

 
   Friend Function GetHardDriveModelNumber() As String
        Return GetDetailsCore
(New Process, Function(current As Process)
 
                                              Using current
                                                   Dim result 
As String CType(NothingString)

 
                                                  Dim pi As ProcessStartInfo = New ProcessStartInfo
                                                   pi
.Arguments "/c wmic diskdrive get Model"
 
                                                  pi.FileName "cmd"
 
                                                  pi.RedirectStandardOutput True
                                                   pi
.UseShellExecute False
                                                   pi
.CreateNoWindow True
                                                   current
.StartInfo pi
                                                   current
.Start()
 
                                                  Using reader As StreamReader current.StandardOutput
                                                       result 
CStr(reader.ReadToEnd())
 
                                                  End Using

                                                   
' check if string contains white space, if true remove wite spaces 
                                                   If result.Contains(" ") Then
                                                       result = result.Replace(" ", "")
                                                   End If

                                                   '
check if string contains dots, if true remove dots
                                                   
If result.Contains("."Then
                                                       result 
result.Remove(".""")
 
                                                  End If

 
                                                  ' check if string contains dashes, if true remove wite dashes 
                                                   If result.Contains("-") Then
                                                       result = result.Replace("-", "")
                                                   End If

                                                   ' 
check if string contains the word model, if true remove word model
                                                   
If result.Contains("Model"Then
                                                       result 
result.Replace("Model""")
 
                                                  End If
 
                                                  Return result

                                               End Using
                                               
Return Nothing
                                           End 
Function)
 
   End Function

 
   Friend Function GetMemorychipSerialNumber() As String
        Return GetDetailsCore
(New Process, Function(current As Process)
 
                                              Using current
                                                   Dim result 
As String CType(NothingString)

 
                                                  Dim pi As ProcessStartInfo = New ProcessStartInfo
                                                   pi
.Arguments "/c wmic memorychip get SerialNumber"
 
                                                  pi.FileName "cmd"
 
                                                  pi.RedirectStandardOutput True
                                                   pi
.UseShellExecute False
                                                   pi
.CreateNoWindow True
                                                   current
.StartInfo pi
                                                   current
.Start()
 
                                                  Dim reader As StreamReader current.StandardOutput
                                                   result 
CStr(reader.ReadToEnd())

 
                                                  ' check if string contains white space, if true remove wite spaces 
                                                   If result.Contains(" ") Then
                                                       result = result.Replace(" ", "")
                                                   End If

                                                   '
check if string contains dots, if true remove dots
                                                   
If result.Contains("."Then
                                                       result 
result.Remove(".""")
 
                                                  End If

 
                                                  ' check if string contains dashes, if true remove wite dashes 
                                                   If result.Contains("-") Then
                                                       result = result.Replace("-", "")
                                                   End If

                                                   ' 
check if string contains the word model, if true remove word model
                                                   
If result.Contains("SerialNumber"Then
                                                       result 
result.Replace("SerialNumber""")
 
                                                  End If
 
                                                  Return result

                                               End Using
                                               
Return Nothing
                                           End 
Function)
 
   End Function 

دخلتني في دوامه يا اخي مش ادر اطلع منها
المهم بارك الله فيك وشكرااا على المشاركة 
القيت الحل من الاخ  سعود الشامان


لا تحزن إذا جاءك سهم قاتل من أقرب الناس إلى قلبك

[صورة مرفقة: 2015%2B-%2B1]
الرد }}}
تم الشكر بواسطة:
#12
يا محمد الاخ silverlight من كبار الشخصيات في المنتدى وبخبرته ومساهماته ساعد الكثير من الاعضاء هنا وهو ماشاء الله على معرفة واسعة ربي يزيده ويباركله في علمه
غير حب يستوضح منك الطلب من الاول بس
المهم بعد ما تكمل نبيه برنامجك متاع الفيديو لاني نستخدم في البرنامج الاصلي وماذا بيا نحصل واحد UI

الرد }}}
تم الشكر بواسطة: سعود الشامان , mohammedvego
#13
خلاص لما انكمل المشروع رح ابعتلك نسخه من البرنامج باسمك
راسلني فيسبوك
https://www.facebook.com/mohammedalaeer


لا تحزن إذا جاءك سهم قاتل من أقرب الناس إلى قلبك

[صورة مرفقة: 2015%2B-%2B1]
الرد }}}
تم الشكر بواسطة:



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


يقوم بقرائة الموضوع: بالاضافة الى ( 1 ) ضيف كريم