| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1004 人关注过本帖
标题:[求助]求助VB修改注册表的问题
取消只看楼主 加入收藏
cqzxc
Rank: 2
等 级:论坛游民
帖 子:8
专家分:10
注 册:2006-11-13
收藏
 问题点数:0 回复次数:3 
[求助]求助VB修改注册表的问题

Private Sub Command1_Click()
'建立键值
CreateNewKey HKEY_LOCAL_MACHINE, "SOFTWARE\SoftNyx"
CreateNewKey HKEY_LOCAL_MACHINE, "SOFTWARE\SoftNyx\GunBound"
'MySamples\Samples1下建立一个字符串值和一个整数值
SetKeyValue HKEY_LOCAL_MACHINE, "SOFTWARE\SoftNyx\GunBound", "AppID1", 101, REG_DWORD
SetKeyValue HKEY_LOCAL_MACHINE, "SOFTWARE\SoftNyx\GunBound", "AppID2", 102, REG_DWORD
SetKeyValue HKEY_LOCAL_MACHINE, "SOFTWARE\SoftNyx\GunBound", "AppID3", 103, REG_DWORD
SetKeyValue HKEY_LOCAL_MACHINE, "SOFTWARE\SoftNyx\GunBound", "AutoRefresh", 1, REG_DWORD
SetKeyValue HKEY_LOCAL_MACHINE, "SOFTWARE\SoftNyx\GunBound", "Background", 1, REG_BINARY
SetKeyValue HKEY_LOCAL_MACHINE, "SOFTWARE\SoftNyx\GunBound", "BuddyIP", "127.0.0.1", REG_SZ
SetKeyValue HKEY_LOCAL_MACHINE, "SOFTWARE\SoftNyx\GunBound", "ChannelName", 0, REG_BINARY
SetKeyValue HKEY_LOCAL_MACHINE, "SOFTWARE\SoftNyx\GunBound", "Effect3D", 2, REG_BINARY
SetKeyValue HKEY_LOCAL_MACHINE, "SOFTWARE\SoftNyx\GunBound", "EffectVolume", 95, REG_DWORD
SetKeyValue HKEY_LOCAL_MACHINE, "SOFTWARE\SoftNyx\GunBound", "GameName", 0, REG_BINARY
SetKeyValue HKEY_LOCAL_MACHINE, "SOFTWARE\SoftNyx\GunBound", "IP", "127.0.0.1", REG_SZ
SetKeyValue HKEY_LOCAL_MACHINE, "SOFTWARE\SoftNyx\GunBound", "Language", 1, REG_DWORD
SetKeyValue HKEY_LOCAL_MACHINE, "SOFTWARE\SoftNyx\GunBound", "LastID", 0, REG_BINARY
SetKeyValue HKEY_LOCAL_MACHINE, "SOFTWARE\SoftNyx\GunBound", "Location", fname & App.Path, REG_SZ
SetKeyValue HKEY_LOCAL_MACHINE, "SOFTWARE\SoftNyx\GunBound", "MidiMode", 1, REG_BINARY
SetKeyValue HKEY_LOCAL_MACHINE, "SOFTWARE\SoftNyx\GunBound", "MouseSpeed", 50, REG_DWORD
SetKeyValue HKEY_LOCAL_MACHINE, "SOFTWARE\SoftNyx\GunBound", "MusicVolume", 95, REG_DWORD
SetKeyValue HKEY_LOCAL_MACHINE, "SOFTWARE\SoftNyx\GunBound", "port", 8372, REG_DWORD
SetKeyValue HKEY_LOCAL_MACHINE, "SOFTWARE\SoftNyx\GunBound", "Screen", fname & App.Path, REG_SZ
SetKeyValue HKEY_LOCAL_MACHINE, "SOFTWARE\SoftNyx\GunBound", "ShootingMode", 0, REG_BINARY
SetKeyValue HKEY_LOCAL_MACHINE, "SOFTWARE\SoftNyx\GunBound", "Version", 312, REG_DWORD


End Sub

Private Sub Form_Load()
strPath = App.Path
Text1 = strPath
Dim fname As String
If Right(App.Path, 1) = "\" Then
fname = App.Path
Else
fname = App.Path & "\"
End If
'建立键值
CreateNewKey HKEY_LOCAL_MACHINE, "SOFTWARE\SoftNyx"
CreateNewKey HKEY_LOCAL_MACHINE, "SOFTWARE\SoftNyx\GunBound"
'MySamples\Samples1下建立一个字符串值和一个整数值
SetKeyValue HKEY_LOCAL_MACHINE, "SOFTWARE\SoftNyx\GunBound", "AppID1", 101, REG_DWORD
SetKeyValue HKEY_LOCAL_MACHINE, "SOFTWARE\SoftNyx\GunBound", "AppID2", 102, REG_DWORD
SetKeyValue HKEY_LOCAL_MACHINE, "SOFTWARE\SoftNyx\GunBound", "AppID3", 103, REG_DWORD
SetKeyValue HKEY_LOCAL_MACHINE, "SOFTWARE\SoftNyx\GunBound", "AutoRefresh", 1, REG_DWORD
SetKeyValue HKEY_LOCAL_MACHINE, "SOFTWARE\SoftNyx\GunBound", "Background", 1, REG_BINARY
SetKeyValue HKEY_LOCAL_MACHINE, "SOFTWARE\SoftNyx\GunBound", "BuddyIP", "127.0.0.1", REG_SZ
SetKeyValue HKEY_LOCAL_MACHINE, "SOFTWARE\SoftNyx\GunBound", "ChannelName", 0, REG_BINARY
SetKeyValue HKEY_LOCAL_MACHINE, "SOFTWARE\SoftNyx\GunBound", "Effect3D", 2, REG_BINARY
SetKeyValue HKEY_LOCAL_MACHINE, "SOFTWARE\SoftNyx\GunBound", "EffectVolume", 95, REG_DWORD
SetKeyValue HKEY_LOCAL_MACHINE, "SOFTWARE\SoftNyx\GunBound", "GameName", 0, REG_BINARY
SetKeyValue HKEY_LOCAL_MACHINE, "SOFTWARE\SoftNyx\GunBound", "IP", "127.0.0.1", REG_SZ
SetKeyValue HKEY_LOCAL_MACHINE, "SOFTWARE\SoftNyx\GunBound", "Language", 1, REG_DWORD
SetKeyValue HKEY_LOCAL_MACHINE, "SOFTWARE\SoftNyx\GunBound", "LastID", 0, REG_BINARY
SetKeyValue HKEY_LOCAL_MACHINE, "SOFTWARE\SoftNyx\GunBound", "Location", Text1 & App.Path, REG_SZ
SetKeyValue HKEY_LOCAL_MACHINE, "SOFTWARE\SoftNyx\GunBound", "MidiMode", 1, REG_BINARY
SetKeyValue HKEY_LOCAL_MACHINE, "SOFTWARE\SoftNyx\GunBound", "MouseSpeed", 50, REG_DWORD
SetKeyValue HKEY_LOCAL_MACHINE, "SOFTWARE\SoftNyx\GunBound", "MusicVolume", 95, REG_DWORD
SetKeyValue HKEY_LOCAL_MACHINE, "SOFTWARE\SoftNyx\GunBound", "port", 8372, REG_DWORD
SetKeyValue HKEY_LOCAL_MACHINE, "SOFTWARE\SoftNyx\GunBound", "ShootingMode", 0, REG_BINARY
SetKeyValue HKEY_LOCAL_MACHINE, "SOFTWARE\SoftNyx\GunBound", "Version", 312, REG_DWORD
End Sub

Private Sub Label1_Click()

End Sub


谁能帮帮忙啊~~修改不注册表路径不支持中文啊~~~

文件路径如果是中文的话显示就不完全啊~~~

各位大哥大姐帮帮啊

SetKeyValue HKEY_LOCAL_MACHINE, "SOFTWARE\SoftNyx\GunBound", "Location", Text1 & App.Path, REG_SZ
就是这一项是修改文件路径的~~~

我已经把源代码传上来了~~~

mEIffVQN.rar (7.29 KB) [求助]求助VB修改注册表的问题


搜索更多相关主题的帖子: 注册表 MACHINE SOFTWARE HKEY 
2006-11-13 08:52
cqzxc
Rank: 2
等 级:论坛游民
帖 子:8
专家分:10
注 册:2006-11-13
收藏
得分:0 
哈哈谢谢
2006-11-13 09:24
cqzxc
Rank: 2
等 级:论坛游民
帖 子:8
专家分:10
注 册:2006-11-13
收藏
得分:0 
晕死啊~~~不是VB的~~你能不能搞个VB的啊
2006-11-13 09:25
cqzxc
Rank: 2
等 级:论坛游民
帖 子:8
专家分:10
注 册:2006-11-13
收藏
得分:0 

兄弟能否给我一个完整的代码呢~~~~

2006-11-13 20:53
快速回复:[求助]求助VB修改注册表的问题
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.020133 second(s), 9 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved