Click here to Skip to main content
15,896,425 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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
C#
dynamic fileSystem = AutomationFactory.CreateObject("Scripting.FileSystemObject");
dynamic drives = fileSystem.Drives;


these two line to vb.net
VB
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
Posted
Comments
[no name] 4-Aug-13 10:50am    
Just use Object and you should be fine.
Aravindba 4-Aug-13 10:55am    
can u use my code and give the object
Dim fileSystem As dynamic = AutomationFactory.CreateObject("Scripting.FileSystemObject")
Dim drives As dynamic = fileSystem.Drives

in above code what i give ? where i give object ?
Aravindba 4-Aug-13 11:04am    
ok Thank for ur reply,'object' is work instead of 'dynamic' keyword,

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/[^]
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900