هذا مثال من الصفحة التي وضعتها مع اضافة مؤقت لتغيير رقم الايبي كل ثانية
هناك خطأ في الكود
ChangeIP("192.168.1." & i.ToString("000"))
Txt_IPAddress.Text = "192.168.1." & i.ToString("000")
System.InvalidCastException
HResult=0x80004002
Message=Conversion from string "192.168.1.001" to type 'Integer' is not valid.
Source=Microsoft.VisualBasic
StackTrace:
at Microsoft.VisualBasic.CompilerServices.Conversions.ToInteger(String Value)
at ChangeIPAddressXT.Form1.Timer1_Tick(Object sender, EventArgs e) in C:\Users\ahmed-pc\Downloads\ChangeIPAddressXT\ChangeIPAddressXT\Form1.vb:line 44
at System.Windows.Forms.Timer.OnTick(EventArgs e)
at System.Windows.Forms.Timer.TimerNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)
at ChangeIPAddressXT.My.MyApplication.Main(String[] Args) in :line 81
Inner Exception 1:
FormatException: Input string was not in a correct format.
عفوا عدل الاكواد التالية :
PHP كود :
ChangeIP("192.168.1." & i)
Txt_IPAddress.Text = "192.168.1." & i
تم والحمد لله الكود يعمل كان يحتاج التشغيل كمسؤل ممكن تحديد عدد ثواني تغير الاي بي وشكرا لك
غير خاصية Interval من 1000 اي ثانية الى الوقت الذي تريده كل 1000 ميلي ثانية تعني ثانية .
شكرا لك استاذ asemshahen5