บทความ

กำลังแสดงโพสต์จาก มีนาคม, 2012

Creating Components Dynamically (at Run-Time) in Delphi

When we do programming in Delphi we don’t need to dynamically create a component. If we drop a component on a form, Delphi handles the component creation automatically when the form is created. But we can also create components at run-time. Here I would like to explain how we can programmatically create components at run-time. Dynamic Component Creation There are two ways to dynamically create components. One way is to make a form (or some other TComponent) the owner of the new component. This is a common practice when building composite components where a visual container creates and owns the subcomponents. Doing so will ensure that the newly-created component is destroyed when the owning component is destroyed. To create an instance (object) of a class, you call its “Create” method. The Create constructor is a class method, as opposed to virtually all other methods you’ll encounter in Delphi programming, which are object methods. For example, the TComponent declares the Create co...

เปลี่ยน ip address script

เขียน Script ไว้แล้ว Save เป็น .Bat เมื่อเราต้องการใช้แบบ Static ก็คลิ๊กตัวนึง เมื่อเราต้องการใช้แบบ DHCP ก็คลิ๊กตัวนึง ตัวอย่างรูปแบบคำสั่งด้านล่างนะครับ ----------------------------------------------------------------------- คำสั่งเปลียน IP Subnet และ Gateway ให้เป็นแบบ Static netsh interface ip set address "ชื่อCardLan" static "IP" "Subnet" "GW" 1 ตัวอย่าง netsh interface ip set address Wlan static 192.168.0.22 255.255.255.0 192.168.0.2 1 เอาใส่ Notepad แล้วก็ Save เป็น .Bat ----------------------------------------------------------------------- คำสั่งเปลียน IP Subnet และ Gateway ให้เป็นแบบ DHCP netsh interface ip set address "ชื่อCardLan" dhcp ตัวอย่าง netsh interface ip set address Wlan dhcp เอาใส่ Notepad แล้วก็ Save เป็น .Bat ----------------------------------------------------------------------- คำสั่งเปลี่ยน DNSให้เป็นแบบ DHCP netsh interface ip set dns "ชื่อการ์ดlan" dhcp ตัวอย่าง netsh interface ip set d...