Hey, I wonder how all this is in VB.NET
In C#
UserSettings vUsers = new UserSettings();
UserSettings.IUserSettings vUserI = (UserSettings.IUserSettings)vUsers
I took a chance to try to write it in VB.NET, but is this right?
In VB.NET
Dim vUsers As UserSettings = New UserSettings()
Dim vUserI As UserSettings.IUserSettings = (UserSettings.IUserSetting开发者_开发知识库s)vUsers
You are casting directly in c#, so I should think DirectCast would be the method to use here.
Dim vUsers As New UserSettings()
Dim vUserI As UserSettings.IUserSettings = DirectCast(vUsers, UserSettings.IUserSettings)
it will be written in vb.Net as:
Dim vUsers As New UserSettings()
Dim vUserI As UserSettings.IUserSettings = DirectCast(vUsers, UserSettings.IUserSettings)
Further, you can try this for any C# to VB.Net conversion:
http://www.developerfusion.com/tools/convert/csharp-to-vb/
Hope this Helps!!
精彩评论