vb.net - Use ASP.net 2010 B to Ping an IP Address -
i'm trying use simple ping technique ping ip address. have added imports system.net.networkinformation.ping
web page , tried create button once clicked ping ip address.
the problem have error message states 'system.net.networkinformation' namespace , cannot used expression.
i'm new , have tried replace else, still cannot seem work. possible review , let me know i'm going wrong. im using vb , vs2010. code:
imports system.text imports system.net.networkinformation.ping partial class ping inherits system.web.ui.page protected sub btnping_click(sender object, e system.eventargs) handles btnping.click using system.net.networkinformation ping(ping = new ping()) pingreply(pingreply = ping.send("xxx.xx.xxx.xx")) console.writeline("address: {0}", pingreply.address) console.writeline("status: {0}", pingreply.status) end using end sub end class
you better off trying following:
imports system.text imports system.net.networkinformation
partial class ping inherits system.web.ui.page protected sub btnping_click(sender object, e system.eventargs) handles btnping.click dim vping new ping dim vpingreply pingreply = vping.send("xxx.xx.xxx.xx") console.writeline("address: {0}", vpingreply.address) console.writeline("status: {0}", vpingreply.status) end sub
system.net.networkinformation
namespace, serves container other classes.
Comments
Post a Comment