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

نسخة كاملة : مساعدة في مشروع برنامج يفك تشفير الفيديو المسجل من رسيفر لتشغيلها على الحاسب
أنت حالياً تتصفح نسخة خفيفة من المنتدى . مشاهدة نسخة كاملة مع جميع الأشكال الجمالية .
الصفحات : 1 2
السلام عليكم 
هذه اول مشاركة  ليا في هذا المنتدى الراقي وقد استفدت منا في مسيرتي البرمجيه خبرات اود ان شكركم جميعا 
احتاج مساعدة في تعديل  مشروعي  لمسه الاخيره 
وهيا اخفاء موجه الاوامر cmd من على الفورم  



ماذا تقصد بكلمة موجه الأوامر
(06-11-17, 10:31 AM)silverlight كتب : [ -> ]ماذا تقصد بكلمة موجه
CMD
هل تقصد مؤشر الماوس؟
(06-11-17, 11:13 AM)silverlight كتب : [ -> ]هل تقصد مؤشر الماوس؟
ههههههههههه لا يا اخي   ليس مؤشر الماوس   Wink

ابحث في القوقل ستعرف ما هو
عذرا يا اخي الفاضل تحملني قليلا لأني جديد في البرمجة و مش فاهم
ممكن توضح قصدك بكامة cmd و بدون البحث في جوجل
هل تقصد command line window?
نعم هذه هيا command line
ما أتوقعه هو انك تقوم باستدعاء 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 
مشاء الله طلعت فاهم اكثر مني
اضافة الى ما ذكره اخوي silverlight


https://youtu.be/2K4mrj5aI4c
الصفحات : 1 2