vb.net事件代理的简单介绍( 三 )
Console.WriteLine(" Stop Alarm? Enter Q")
Dim input As String = Console.ReadLine()
If input.Equals("Y") Or input.Equals("y") Then
Return
Else
If input.Equals("N") Or input.Equals("n") Then
CType(sender, AlarmClock).SnoozePressed = True
Return
Else
CType(sender, AlarmClock).Stop = True
Return
End If
End If
End If
Else
Console.WriteLine(" Let alarm ring? Enter Y")
Console.WriteLine(" Stop Alarm? Enter Q")
Dim input As String = Console.ReadLine()
If input.Equals("Y") Or input.Equals("y") Then
Return
Else
CType(sender, AlarmClock).Stop = True
Return
End If
End If
End Sub
End Class
' The driver class that hooks up the event handling method of
' WakeMeUp to the alarm event of an Alarm object using a delegate.
' In a forms-based application, the driver class is the
' form.
'
Public Class AlarmDriver
Public Shared Sub Main()
' Instantiates the event receiver.
Dim w As New WakeMeUp()
' Instantiates the event source.
Dim clock As New AlarmClock()
' Wires the AlarmRang method to the Alarm event.
AddHandler clock.Alarm, AddressOf w.AlarmRang
clock.Start()
End Sub
End Class
End Namespace
vb.net怎样设置ie浏览器的代理服务器地址建议vb.net事件代理你使用注册表vb.net事件代理的API进行修改
封装两个NET函数给vb.net事件代理你
private string GetReg(string RegPath)取得注册表项内容
{
string str="";
RegistryKey hkml = Registry.LocalMachine;
RegistryKey software = hkml.OpenSubKey("SOFTWARE",true);
RegistryKey aimdir = software.OpenSubKey("krabs",true);
if (aimdir != null)
{
if (aimdir.GetValue(RegPath) != null)
str = aimdir.GetValue(RegPath).ToString();
if (str != null)
return str;
return null;
}
return null;
}
private bool SetReg(string RegPath,string Data)//设置注册表内容
{
RegistryKey reg = Registry.LocalMachine;
RegistryKey software = reg.OpenSubKey("SOFTWARE", true);
RegistryKey aimdir1 = software.CreateSubKey("krabs");
if (aimdir1 == null)
return false;
aimdir1.SetValue(RegPath, Data);
return true;
}
【vb.net事件代理的简单介绍】关于vb.net事件代理和的介绍到此就结束了,不知道你从中找到你需要的信息了吗 ?如果你还想了解更多这方面的信息 , 记得收藏关注本站 。
- redis 时间序列 redis时间事件周期
- 如何通过成为戴尔服务器代理商赚取利润? 戴尔服务器代理商怎么赚钱
- 戴尔服务器代理服务的收费方式是什么? 戴尔服务器代理怎么收费
- mysql定时执行sql mysql事件定时删除
- redis过期触发事件 redis过期提醒php
- redis过期实现原理 redis过期事件
- mysql事件每天执行一次 mysql每天一条数据
- redis 超时触发事件 redis做订单超时支付
- redis 超时触发事件 redis链接超时
- java监听事件原理 java监听mongodb变化
