Vb.net 尝试使用任何Atribue declarion时出错<;属性>;运动模拟

Vb.net 尝试使用任何Atribue declarion时出错<;属性>;运动模拟,vb.net,attributes,Vb.net,Attributes,我在尝试使用使用属性的代码时出错 Public Class <AttributeUsageAttribute(Of AttributeTargets, AllowMultiple := True)> CustomPermissionAttribute Inherits CodeAccessSecurityAttribute Private myUnrestricted As Boolean = False End Class 公共类CustomPermissionAttribute

我在尝试使用使用属性的代码时出错
Public Class <AttributeUsageAttribute(Of AttributeTargets, AllowMultiple := True)> CustomPermissionAttribute Inherits CodeAccessSecurityAttribute
Private myUnrestricted As Boolean = False End Class
公共类CustomPermissionAttribute继承CodeAccessSecurityAttribute
Private myUnrestricted As Boolean=False结束类

当我得到这个错误时,VS首先开始“这是无效的语法。你想做什么?我正在尝试使用我发现的一些代码片段,这些代码片段必须具有安全权限。我很高兴你说它无效。vb不接受这样的代码。我应该做点别的吗?如果是这样的话,你能给我指个方向吗。。。谢谢你不;这毫无意义。这是普通类声明语法和属性应用程序语法的混合。你需要学习VB属性;请参阅文档。感谢您的帮助。我一直在微软网站上引用这种类型的代码,如果你在那里随便看看,他们在vb.net中使用这种类型的代码。也许我遗漏了一个参考资料?请仔细阅读。该属性位于类声明之上。