如何在vb.net中提供动态关键字? [英] How to give dynamic keyword in vb.net ?

查看:139
本文介绍了如何在vb.net中提供动态关键字?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我将一个项目表单C#转换为vb.net,因为我在'dynamice'关键字中有问题,vb.net中没有关键字。

我是什么转换是

 动态 fileSystem = AutomationFactory.CreateObject(   Scripting.FileSystemObject); 
dynamic drives = fileSystem.Drives;





这两个line to vb.net

  Dim  fileSystem  As  dynamic = AutomationFactory.CreateObject(  Scripting.FileSystemObject
Dim drive As dynamic = fileSystem.Drives





但是在错误窗口中它显示了vb.net中动态关键字中的类型例外。



所以请回复如何解决这个问题在vb.net





问候

Aravind

解决方案

阅读以下内容: http://social.msdn.microsoft.com/Forums/en-US/22cc1e87 -8a51-4d49-8adb-df110d40e36f / dynamic-keyword-equivalent-in-vbnet [ ^ ]


没有相应的C#Dynamic在vb.net中代替你只能将动态替换为对象如果你设置选项严格关闭



如果你正在寻找一个工具然后尝试夏普开发。 />
它是dot net的开源IDE。您可以将代码转换为ff:

VB.Net

C#.NET等...



在这里获得Sharp Develop

http://www.icsharpcode.net/opensource/sd/下载/ [ ^ ]

Hi I convert one project form C# to vb.net,in that i have a problem in 'dynamice' keyword,there is no keyword in vb.net.
what i convert is

dynamic fileSystem = AutomationFactory.CreateObject("Scripting.FileSystemObject");
dynamic drives = fileSystem.Drives;



these two line to vb.net

Dim fileSystem As dynamic = AutomationFactory.CreateObject("Scripting.FileSystemObject")
Dim drives As dynamic = fileSystem.Drives



but in error window it show the "Type excepted" in dynamic keyword in vb.net.

So pls reply how to solve this problem in vb.net


Regards
Aravind

解决方案

Read the following : http://social.msdn.microsoft.com/Forums/en-US/22cc1e87-8a51-4d49-8adb-df110d40e36f/dynamic-keyword-equivalent-in-vbnet[^]


There is no equivalent of C# Dynamic in vb.net instead you can replace dynamic into Object only if you set option strict off

If you are looking for a tool then try Sharp develop.
It is a Open Source IDE for dot net. You can convert your code to the ff:
VB.Net
C#.NET etc...

Get Sharp Develop here
http://www.icsharpcode.net/opensource/sd/download/[^]


这篇关于如何在vb.net中提供动态关键字?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆