c# - arp -a and route print -
i need write program displays information:
- netstat
- tcp / udp connections
- information ip ipconfig /all
- arp-a
- route print
i have of them, have problem route print
, arp -a
. not want execute command using process.start()
because not spectacular:
process p = new process (); p.startinfo.windowstyle = processwindowstyle.hidden; p.startinfo.useshellexecute = false; p.startinfo.filename = "route"; p.startinfo.arguments = "print"; p.startinfo.redirectstandardoutput = true; p.startinfo.createnowindow = true; p.startinfo.standardoutputencoding = encoding.default; p.startinfo.windowstyle = processwindowstyle.hidden; p.start(); textbox1.text = p.standardoutput.readtoend();
i use foreach loop data listview or datagrid columns. has ~ t able me? how can data each column: destination, netmask, gateway, interface, metrics , permanent route? , in case of arp, internet address type of physical address?
i suppose parse text retrieve out values want , put them in listview
etc. however, think there better ways retrieve , think you'd able out information using wmi class win32_ip4routetable.
if haven't used wmi before, might able use wmi code creator v1.0 started (i haven't used myself, saw else suggesting sometime).
the wmi .net overview useful too.
Comments
Post a Comment