我正在使用VB语言编写一个项目,当我尝试编译它时,我正面临这种类型的错误“'IADsLargeInteger'在命名空间'ActiveDs'中是不明确的”这是代码的一部分给我错误:
Function GetLargeInteger(ByVal val As Int64) As
IADsLargeInteger
Dim largeInt As New ActiveDs.LargeInteger
largeInt.HighPart = CType((val >> 32), Integer)
val = val << 32
val = val >> 32
largeInt.LowPart = (Convert.ToInt32(val))
Return largeInt
End Function
我也导入了:
Imports Dar.DAL
Imports DbShare
Imports System.DirectoryServices
Imports System.Xml.Serialization
Imports System.IO
Imports Dar.BLL.Interfaces
Imports Dar.DAL.Repositories
Imports Dar.BLL.Services
Imports System.Security.Principal
Imports System.Threading
Imports System.Globalization
Imports Elmah
Imports System.Configuration
Imports ActiveDs
请帮助,因为我没有得到出错的地方
错误消息告诉您的是IADsLargeInteger
在某处定义了多次,编译器不知道使用哪一个。您要么必须删除一个定义(一个的imports语句),要么完全指向您要使用的定义。我假设你要使用的那个包含在ActiveDS
中给出了largeint
声明,所以更改你的函数以返回那个:
Function GetLargeInteger(ByVal val As Int64) As ActiveDS.IADsLargeInteger
Dim largeInt As New ActiveDs.LargeInteger
largeInt.HighPart = CType((val >> 32), Integer)
val = val << 32
val = val >> 32
largeInt.LowPart = (Convert.ToInt32(val))
Return largeInt
End Function