[VB.NET]windows service中如何读取注册表

来源:互联网 发布:华信在线网络贷款 编辑:程序博客网 时间:2024/06/04 19:20
VB.NET源码-156个实用实例哦……<script type="text/javascript"><!--google_ad_client = "pub-8333940862668978";/* 728x90, 创建于 08-11-30 */google_ad_slot = "4485230109";google_ad_width = 728;google_ad_height = 90;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
windows service中如何读取注册表
我的程序调用api函数来读取注册表,但一启动就出错,该如何解决?
__________________________________________________________________________
.NET中不用API来读注册表了,那个API可能不支持了吧。
__________________________________________________________________________
Dim readValue As String
readValue = My.Computer.Registry.GetValue( "HKEY_CURRENT_USER/Software/MyApp ", "Name ", Nothing)
MsgBox( "The value is " & readValue)
__________________________________________________________________________
又如何获取服务程序的路径?
__________________________________________________________________________
程序EXE文件的存放路径是

Application.StartupPath

您可以用

MsgBox(Application.StartupPath)

看一下,是不是您需要的。
__________________________________________________________________________
原创粉丝点击