| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1452 人关注过本帖
标题:有問題求教
只看楼主 加入收藏
shankhands
Rank: 1
等 级:新手上路
帖 子:24
专家分:0
注 册:2008-10-6
收藏
 问题点数:0 回复次数:3 
有問題求教
我用的是,想用如下代碼實現獲得本地计算机上的拨号网络的项目

    Public Class Form1
    Private Declare Function RegOpenKey Lib "advapi32.dll" Alias "RegOpenKeyA" ( _
    ByVal bKey As Integer, ByVal lpSubKey As String, ByRef phkResult As Integer) As Integer
    Private Declare Function RegCloseKey Lib "advapi32.dll" (ByVal hKey As Integer) As Integer
    Private Declare Function RegEnumKey Lib "advapi32.dll" Alias _
    "RegEnumKeyA" (ByVal hKey As Integer, ByVal dwIndex As Integer, ByVal _
    lpName As String, ByVal chName As Integer) As Integer
    Const HKEY_CURRENT_USER As Integer = &H80000001
    Const ERROR_NO_MORE_ITEMS As Short = 259
    Const ERROR_SUCCESS As Short = 0
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim hKey As Integer
        Dim i As Integer
        'Dim astr As VBFixedStringAttribute
        Dim astr As VB6.fixedLengthString = New VB6.fixedLengthstring(256)
        If RegOpenKey(HKEY_CURRENT_USER, "RemoteAccess\Profile", hKey) = ERROR_SUCCESS Then
            While RegEnumKey(hKey, i, astr.value, 256) = ERROR_SUCCESS
                ListBox1.Items.Add(astr.value)
            End While
            RegCloseKey(hKey)
        Else
            ListBox1.Items.Add("There is some wrong") '此語句是用來說明沒有執行
        End If

    End Sub
End Class
出現的錯誤是:    未定义类型“VB6.fixedLengthString”。
請問這是怎麼回事.
在此先謝謝了!
搜索更多相关主题的帖子: 计算机 网络 
2008-10-17 14:56
fairy4
Rank: 4
等 级:贵宾
威 望:10
帖 子:738
专家分:267
注 册:2007-11-1
收藏
得分:0 
你从那里找了段VB6的代码升级的?添加这个组件吧
 Microsoft.
再Imports Microsoft.

一个人只有一个心脏,却有两个心房。一个住着快乐;一个住着悲伤。不要笑得太大声,不然会吵醒旁边的悲伤
2008-10-17 15:42
shankhands
Rank: 1
等 级:新手上路
帖 子:24
专家分:0
注 册:2008-10-6
收藏
得分:0 
謝謝fairy4幫助!
2008-10-17 17:56
bygg
Rank: 16Rank: 16Rank: 16Rank: 16
来 自:乖乖的心中
等 级:版主
威 望:241
帖 子:13555
专家分:3076
注 册:2006-10-23
收藏
得分:0 
未定义类型“VB6.fixedLengthString”。这样的错误,要么是缺少引用,要么是缺少添加组件...

飘过~~
2008-10-17 20:15
快速回复:有問題求教
数据加载中...
 
   



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

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