1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
|
class (object): def __init__(self): self.name = "宽带连接" self.username = 'adsl_uname' self.password = 'adsl_upwd' def connect(self): cmd_str = "rasdial %s %s %s" % (self.name, self.username, self.password) os.system(cmd_str) time.sleep(5) def disconnect(self): cmd_str = "rasdial %s /disconnect" % self.name os.system(cmd_str) time.sleep(5) def reconnect(self): self.disconnect() self.connect()
|
近期评论