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

ابحث في القوقل ستعرف ما هو
06-11-17, 11:41 AM
عذرا يا اخي الفاضل تحملني قليلا لأني جديد في البرمجة و مش فاهم
ممكن توضح قصدك بكامة cmd و بدون البحث في جوجل
هل تقصد command line window?
ممكن توضح قصدك بكامة cmd و بدون البحث في جوجل
هل تقصد command line window?
06-11-17, 12:01 PM
نعم هذه هيا command line
06-11-17, 12:07 PM
ما أتوقعه هو انك تقوم باستدعاء Process معينة و تقوم بتشغيلها
أتمني يكون توقعاتي صحيحة
في تلك الحالة يجب أن تتعامل مع الكلاس ProcessStartInfo
ولإخفاء نافذة الأوامر
يكفي أن تكتب الكود كالتالي
مثال بسيط علي كيفية التعامل مع Command Line Window
المثال يوضح كيفية تمرير أوامر CMD و القراءة من Command Line لكي تحصل علي نتائج معينة
أتمني يكون توقعاتي صحيحة
في تلك الحالة يجب أن تتعامل مع الكلاس ProcessStartInfo
PHP كود :
Dim pi As ProcessStartInfo = New ProcessStartInfo
ولإخفاء نافذة الأوامر
يكفي أن تكتب الكود كالتالي
PHP كود :
pi.CreateNoWindow = True
المثال يوضح كيفية تمرير أوامر CMD و القراءة من Command Line لكي تحصل علي نتائج معينة
PHP كود :
Private Function GetDetailsCore(currentProcess As Process, func As Func(Of Process, String)) 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(Nothing, String)
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(Nothing, String)
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
06-11-17, 12:58 PM
مشاء الله طلعت فاهم اكثر مني
06-11-17, 03:44 PM
الصفحات : 1 2