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

سؤال في كيفية تشغيل أمر في ms dos

مغلق
بدأه ramos في 5 يوليو 2006 · 3 رد · 624 مشاهدة · في Microsoft Visual Basic.NET
مشاركة: واتساب X فيسبوك تيليجرام
#1 صاحب الموضوع

رجوكم أريد كودا يشغل أمر في ms dos

مثلا

مثلا ftp> cd downloads

---> CWD downloads

تم تعديل هذه المشاركة بواسطة الغملاسي في 7 يوليو 2006 في 05:41

1.GIF
#2

أجل ممكن يا جماعة كود يمكن من فتح ال MS - DOS من أجل بعض الأشياء الهامة كالـ Ping الـ Format غيرها من تلك الاوامر

و أيضاً رجائاً كيف أخذ المخرجات منها ..............

Mohey Elsharqawy

................*......*.....****.....*.....*..............*...........*.................*......

.................*...*.......****.....*.....*.........*.......*........*........*........*......

...................*..............*.....*.*.*..........*.......*..........*..................*.....

...................*.........****.....*.....*............*.................*.................*.....

#3

معقولة لا يوجد مبرمج واحد يحل هذه المعضلة

1.GIF
#4

السلام عليكم

هنالك ما يعرف بــ Console Application يكون بمثابة الـ DOS يوجد ضمن إنشاء مادة جديدة Insert NewItem

إليك النصوص البرمجية التالية. أو شاهد الملف المرفق.

Imports System.Net
Imports System.IO
Imports System.Text.RegularExpressions

Module GetCurrentIPAddress

	Sub Main()

		Try

			'Get Cuttent Compouter IP Address
			GetIPAddress()

			'Get Yahoo.com IP Address
			GetLookupHostName()

			'Peng an IP Address
			PendIP()

			'Download a file using http
			DownloadFile()

			'Retrieve a Title Tag of Yahoo Home page
			RetrieveSinglePiece()


			Console.ReadLine()

		Catch ex As Exception
			Console.WriteLine(ex.Message)
		End Try


	End Sub


#Region " GetIP "

	Private Sub GetIPAddress()

		'Get Host Name
		Dim HostName As String = System.Net.Dns.GetHostName()

		'Get IP Address
		Dim IPAddress As String = _
		System.Net.Dns.GetHostEntry(HostName).AddressList(0).ToString()

		Console.WriteLine("Host name:" & HostName)
		Console.WriteLine("IP Address:" & IPAddress)
		Console.WriteLine("-------------------------")

	End Sub
#End Region

#Region " GetLookup HostName "
	Private Sub GetLookupHostName()

		'Create an IP Address Class
		Dim IP As System.Net.IPAddress

		'Loop through all IPs in Yahoo Domain Name Server
		For Each IP In System.Net.Dns.GetHostEntry("www.yahoo.com").AddressList
			Console.WriteLine(IP.AddressFamily.ToString())
			Console.WriteLine(IP.ToString())
		Next
		Console.WriteLine("-------------------------")
	End Sub

#End Region

#Region " Pend IP "
	Private Sub PendIP()
		'Add a reference to (PingUtility)
		Console.WriteLine("Milliseconds to contact www.yahoo.com: " & _
		 PingUtility.Pinger.GetPingTime("www.yahoo.com"))
		Console.WriteLine("-------------------------")
	End Sub

#End Region

#Region " Download File "
	Private Sub DownloadFile()

		'Create a Uniform Resource Identifier Variable.
		Dim url As String = "http://www.prosetech.com/index.html"

		'Create  the request.
		Dim PageRequest As System.Net.HttpWebRequest = _
		 CType(WebRequest.Create(url), HttpWebRequest)

		'Get the response
		Dim PageResponse As WebResponse = PageRequest.GetResponse()
		Console.WriteLine("Response Received.")

		'Read the response stream.
		Dim sr As New StreamReader(PageResponse.GetResponseStream())

		'Create a string variable that hold Streaming data
		Dim Page As String = sr.ReadToEnd

		'Close the Stream Reader Object.
		sr.Close()

		'Display the retrieved data.
		Console.WriteLine(Page)

		Console.WriteLine("-------------------------")

	End Sub

#End Region

#Region " RetrieveYahoo's Title "
	Private Sub RetrieveSinglePiece()

		'Create a variable that hold Yahoo HostName
		Dim Url As String = "http://yahoo.com"
		Dim Page As String = String.Empty

		Try
			'Create the request.
			Dim PageRequest As System.Net.HttpWebRequest = _
			CType(WebRequest.Create(Url), HttpWebRequest)

			'Get the response
			Dim PageResponse As WebResponse = PageRequest.GetResponse()
			Console.WriteLine("Response Received.")

			'Read the response stream.
			Dim sr As New StreamReader(PageResponse.GetResponseStream())

			'Create a string variable that hold Streaming data
			Page = sr.ReadToEnd

			'Close the Stream Reader Object.
			sr.Close()

		Catch ex As Exception
			Console.WriteLine(ex.ToString())
		End Try


		'Define the regular expression.
		Dim TitlePattern As String = "<title>(?<match>.*?)</title>"
		Dim TitleRegex As New Regex(TitlePattern, _
		 RegexOptions.IgnoreCase Or RegexOptions.Singleline)

		'Find the Title
		Dim TitleMatch As Match = TitleRegex.Match(Page)


		'Display the title
		If TitleMatch.Success Then
			Console.WriteLine("Found title: " & _
			 TitleMatch.Groups("match").Value)
		End If


		Console.WriteLine("-------------------------")

	End Sub

#End Region

End Module

بالتوفيق إن شاء الله.

GetCurrentIP.rar

في المثال يتضح المقال

هذا الموضوع مغلق.

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