473,405 Members | 2,415 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

microsoft.visualbasic namespace obsolete?

cj
I am under the impression they are obsolete methods included for
backward compatibility. For instance is using
filedatetime("c:\myfile.txt") still the accepted way of getting the date
c:\myfile.txt was last modified? I see filedatetime is in the
Microsoft.VisualBasic namespace. Is there some

dim file as new something
dim lastchanged as date = file.datetime

method we are supposed to use now?

If so what would make it better than filedatetime("c:\myfile.txt")???

I try to avoid functions in microsoft.visualbasic because I want to
learn the new way of doing things but frequently I find the new way is
longer and seems more confusing. Like my example filedatetime(). It'll
do what I need now but should I look for something else???
Apr 23 '07 #1
16 3816
On Apr 23, 2:14 pm, cj <c...@nospam.nospamwrote:
I am under the impression they are obsolete methods included for
backward compatibility. For instance is using
filedatetime("c:\myfile.txt") still the accepted way of getting the date
c:\myfile.txt was last modified? I see filedatetime is in the
Microsoft.VisualBasic namespace. Is there some

dim file as new something
dim lastchanged as date = file.datetime

method we are supposed to use now?

If so what would make it better than filedatetime("c:\myfile.txt")???

I try to avoid functions in microsoft.visualbasic because I want to
learn the new way of doing things but frequently I find the new way is
longer and seems more confusing. Like my example filedatetime(). It'll
do what I need now but should I look for something else???
You'll get a lot of different opinions on this issue. Largely, what
you should do depends on what you plan to do in the future.

If you're planning to become a hard-core .NET developer, you should
definitely learn the .NET way of doing things. (This is especially
true if you want to learn other .NET languages.) The
Microsoft.VisualBasic namespace does include a lot of stuff that is
there to ensure that VB6 code is portable to .NET; we are encouraged
to move away from that namespace to the functionality provided by the
core System namespaces.

The real value of that depends on a number of factors. Is the code
going to be ported to other languages? Will it be used by other
systems? Is it a code library? Or is it a self-contained application
that's a one-shot and not likely going to be used anywhere else?
Practicality should always govern what you decide to do. However,
practicality does *not* mean that you should always have blinders on,
or suffer from a very narrow world view.

Plan for the future. My suggestion is that you keep at it, and move
away from the Microsoft.VisualBasic namespaces. The payoff is
worthwhile. The C# samples that are pervasive don't use that
namespace; you'll find that they're much easier to understand and port
to Visual Basic.NET if you know what they're doing. :) Further, the
pain customary to the learning period is short-lived; once you know
it, you *know* it, and you'll have much more value to everyone.

I hope I haven't overwhelmed you. (I tend to do that sometimes.)

Cheers!
Mike Hofer

Apr 23 '07 #2
>I am under the impression they are obsolete methods included for
backward compatibility.
They are not obsolete.

>Is there some

dim file as new something
dim lastchanged as date = file.datetime

method we are supposed to use now?
System.IO.File.GetLastWriteTime is the alternative - use whatever you
like best.
Mattias

--
Mattias Sjögren [C# MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
Apr 23 '07 #3
"cj" <cj@nospam.nospamschrieb;
>I am under the impression they are obsolete methods included for backward
compatibility.
That's a wrong impression.
dim file as new something
dim lastchanged as date = file.datetime

method we are supposed to use now?

If so what would make it better than filedatetime("c:\myfile.txt")???

I try to avoid functions in microsoft.visualbasic because I want to learn
the new way of doing things but frequently I find the new way is longer
and seems more confusing.
There is no "new way". There is only more than one way. Take a look at the
classes in the 'System.IO' namespace, namely 'File'.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Apr 23 '07 #4
You mean that in the BeNeLux would exist in future only Netherlands way of
life, because the other countries are obsolete. In my idea are the Belgian
and Luxenburg cultures full part of it. Like the MicosoftVisual Basic
namespace is in the Net.

Cor
Apr 24 '07 #5
cj wrote:
I am under the impression they are obsolete methods included for
backward compatibility.
Not so.
Those in MS.VB./Compatibility/ should be used with caution - it contains
those things that we used to use all the time, but have now "grown out"
of, like fixed length strings. They are intended /only/ to get your
application migrated to .Net and from there, you can rewrite bits of it
as necessary.
is using filedatetime("c:\myfile.txt") still the accepted way of getting
the date c:\myfile.txt was last modified?
It's still there; it still works and it's not going anywhere.
Is there some ... method we are supposed to use now?
The FileInfo class wraps this up.
I try to avoid functions in microsoft.visualbasic ...
Some people try to go as far as removing the MS.VB from Visual Basic,
but since the compiler /itself/ makes use of some of the stuff in here
(try creating a VB.Net program that doesn't depend on this assembly!),
it's a pretty pointless exercise.
... because I want to learn the new way of doing things but frequently I
find the new way is longer and seems more confusing.
Agreed.
Anyone found the "new" way of 'ReDim'ing an array?

HTH,
Phill W.
Apr 24 '07 #6
cj
Thanks to everyone for your responses. I'm glad microsoft.visualbasic
is still acceptable, I'll stay away from the Compatibility namespace and
thanks for the tip on system.io.file.

cj wrote:
I am under the impression they are obsolete methods included for
backward compatibility. For instance is using
filedatetime("c:\myfile.txt") still the accepted way of getting the date
c:\myfile.txt was last modified? I see filedatetime is in the
Microsoft.VisualBasic namespace. Is there some

dim file as new something
dim lastchanged as date = file.datetime

method we are supposed to use now?

If so what would make it better than filedatetime("c:\myfile.txt")???

I try to avoid functions in microsoft.visualbasic because I want to
learn the new way of doing things but frequently I find the new way is
longer and seems more confusing. Like my example filedatetime(). It'll
do what I need now but should I look for something else???
Apr 24 '07 #7
"Anyone found the "new" way of 'ReDim'ing an array?"

Actually, you can use Array.Resize (the behavior is identical to ReDim
Preserve, but it's limited to single dimension arrays). But ReDim Preserve
still works fine.
--
David Anton
www.tangiblesoftwaresolutions.com
Instant C#: VB to C# converter
Instant VB: C# to VB converter
Instant C++: C#/VB to C++ converter
Instant Python: C#/VB to Python converter
"Phill W." wrote:
cj wrote:
I am under the impression they are obsolete methods included for
backward compatibility.

Not so.
Those in MS.VB./Compatibility/ should be used with caution - it contains
those things that we used to use all the time, but have now "grown out"
of, like fixed length strings. They are intended /only/ to get your
application migrated to .Net and from there, you can rewrite bits of it
as necessary.
is using filedatetime("c:\myfile.txt") still the accepted way of getting
the date c:\myfile.txt was last modified?
It's still there; it still works and it's not going anywhere.
Is there some ... method we are supposed to use now?

The FileInfo class wraps this up.
I try to avoid functions in microsoft.visualbasic ...

Some people try to go as far as removing the MS.VB from Visual Basic,
but since the compiler /itself/ makes use of some of the stuff in here
(try creating a VB.Net program that doesn't depend on this assembly!),
it's a pretty pointless exercise.
... because I want to learn the new way of doing things but frequently I
find the new way is longer and seems more confusing.

Agreed.
Anyone found the "new" way of 'ReDim'ing an array?

HTH,
Phill W.
Apr 24 '07 #8
You will find some opposition with people who insist on 'pure' .NET
approaches. Some very useful parts have no equivalent in the rest of the
framework, such as the Financial class.
--
David Anton
www.tangiblesoftwaresolutions.com
Instant C#: VB to C# converter
Instant VB: C# to VB converter
Instant C++: C#/VB to C++ converter
Instant Python: C#/VB to Python converter
"cj" wrote:
Thanks to everyone for your responses. I'm glad microsoft.visualbasic
is still acceptable, I'll stay away from the Compatibility namespace and
thanks for the tip on system.io.file.

cj wrote:
I am under the impression they are obsolete methods included for
backward compatibility. For instance is using
filedatetime("c:\myfile.txt") still the accepted way of getting the date
c:\myfile.txt was last modified? I see filedatetime is in the
Microsoft.VisualBasic namespace. Is there some

dim file as new something
dim lastchanged as date = file.datetime

method we are supposed to use now?

If so what would make it better than filedatetime("c:\myfile.txt")???

I try to avoid functions in microsoft.visualbasic because I want to
learn the new way of doing things but frequently I find the new way is
longer and seems more confusing. Like my example filedatetime(). It'll
do what I need now but should I look for something else???
Apr 24 '07 #9
Phill,

I had not the idea that many people are still using the Microsoft
VisualBasic Compatiblility namespace.
It is a temporary namespace, however not containing the members from the
Microsoft Visual Basic namespace we are talking about at the moment. I for
sure would not advice to use that Compatibility namespace withouth the
conversion software.

Cor
"Phill W." <p-.-a-.-w-a-r-d-@-o-p-e-n-.-a-c-.-u-kschreef in bericht
news:f0**********@south.jnrs.ja.net...
cj wrote:
>I am under the impression they are obsolete methods included for backward
compatibility.

Not so.
Those in MS.VB./Compatibility/ should be used with caution - it contains
those things that we used to use all the time, but have now "grown out"
of, like fixed length strings. They are intended /only/ to get your
application migrated to .Net and from there, you can rewrite bits of it as
necessary.
>is using filedatetime("c:\myfile.txt") still the accepted way of getting
the date c:\myfile.txt was last modified?
It's still there; it still works and it's not going anywhere.
>Is there some ... method we are supposed to use now?

The FileInfo class wraps this up.
>I try to avoid functions in microsoft.visualbasic ...

Some people try to go as far as removing the MS.VB from Visual Basic, but
since the compiler /itself/ makes use of some of the stuff in here (try
creating a VB.Net program that doesn't depend on this assembly!), it's a
pretty pointless exercise.
>... because I want to learn the new way of doing things but frequently I
find the new way is longer and seems more confusing.

Agreed.
Anyone found the "new" way of 'ReDim'ing an array?

HTH,
Phill W.

Apr 24 '07 #10
David,

Pure Net approaches needs the Microsoft Visual Basic Namespace the same as
the System.namespace.

That it is possible to work seperately on namespaces is one of the
advantages from .Net

Nobody will tell it there will be more namespaces in Net.

Cor

"David Anton" <Da********@discussions.microsoft.comschreef in bericht
news:47**********************************@microsof t.com...
You will find some opposition with people who insist on 'pure' .NET
approaches. Some very useful parts have no equivalent in the rest of the
framework, such as the Financial class.
--
David Anton
www.tangiblesoftwaresolutions.com
Instant C#: VB to C# converter
Instant VB: C# to VB converter
Instant C++: C#/VB to C++ converter
Instant Python: C#/VB to Python converter
"cj" wrote:
>Thanks to everyone for your responses. I'm glad microsoft.visualbasic
is still acceptable, I'll stay away from the Compatibility namespace and
thanks for the tip on system.io.file.

cj wrote:
I am under the impression they are obsolete methods included for
backward compatibility. For instance is using
filedatetime("c:\myfile.txt") still the accepted way of getting the
date
c:\myfile.txt was last modified? I see filedatetime is in the
Microsoft.VisualBasic namespace. Is there some

dim file as new something
dim lastchanged as date = file.datetime

method we are supposed to use now?

If so what would make it better than filedatetime("c:\myfile.txt")???

I try to avoid functions in microsoft.visualbasic because I want to
learn the new way of doing things but frequently I find the new way is
longer and seems more confusing. Like my example filedatetime(). It'll
do what I need now but should I look for something else???

Apr 24 '07 #11
I don't have a problem with Microsoft.VisualBasic (especially from VB code),
but I'm just indicating the type of respone that some people will give you if
you use it.
--
David Anton
www.tangiblesoftwaresolutions.com
Instant C#: VB to C# converter
Instant VB: C# to VB converter
Instant C++: C#/VB to C++ converter
Instant Python: C#/VB to Python converter
"Cor Ligthert [MVP]" wrote:
David,

Pure Net approaches needs the Microsoft Visual Basic Namespace the same as
the System.namespace.

That it is possible to work seperately on namespaces is one of the
advantages from .Net

Nobody will tell it there will be more namespaces in Net.

Cor

"David Anton" <Da********@discussions.microsoft.comschreef in bericht
news:47**********************************@microsof t.com...
You will find some opposition with people who insist on 'pure' .NET
approaches. Some very useful parts have no equivalent in the rest of the
framework, such as the Financial class.
--
David Anton
www.tangiblesoftwaresolutions.com
Instant C#: VB to C# converter
Instant VB: C# to VB converter
Instant C++: C#/VB to C++ converter
Instant Python: C#/VB to Python converter
"cj" wrote:
Thanks to everyone for your responses. I'm glad microsoft.visualbasic
is still acceptable, I'll stay away from the Compatibility namespace and
thanks for the tip on system.io.file.

cj wrote:
I am under the impression they are obsolete methods included for
backward compatibility. For instance is using
filedatetime("c:\myfile.txt") still the accepted way of getting the
date
c:\myfile.txt was last modified? I see filedatetime is in the
Microsoft.VisualBasic namespace. Is there some

dim file as new something
dim lastchanged as date = file.datetime

method we are supposed to use now?

If so what would make it better than filedatetime("c:\myfile.txt")???

I try to avoid functions in microsoft.visualbasic because I want to
learn the new way of doing things but frequently I find the new way is
longer and seems more confusing. Like my example filedatetime(). It'll
do what I need now but should I look for something else???


Apr 24 '07 #12
cj
Cor, he didn't recommend using the compatibility namespace, just said it
was ok to use microsoft.visualbasic.
Cor Ligthert [MVP] wrote:
Phill,

I had not the idea that many people are still using the Microsoft
VisualBasic Compatiblility namespace.
It is a temporary namespace, however not containing the members from the
Microsoft Visual Basic namespace we are talking about at the moment. I for
sure would not advice to use that Compatibility namespace withouth the
conversion software.

Cor
"Phill W." <p-.-a-.-w-a-r-d-@-o-p-e-n-.-a-c-.-u-kschreef in bericht
news:f0**********@south.jnrs.ja.net...
>cj wrote:
>>I am under the impression they are obsolete methods included for backward
compatibility.
Not so.
Those in MS.VB./Compatibility/ should be used with caution - it contains
those things that we used to use all the time, but have now "grown out"
of, like fixed length strings. They are intended /only/ to get your
application migrated to .Net and from there, you can rewrite bits of it as
necessary.
>>is using filedatetime("c:\myfile.txt") still the accepted way of getting
the date c:\myfile.txt was last modified?
It's still there; it still works and it's not going anywhere.
>>Is there some ... method we are supposed to use now?
The FileInfo class wraps this up.
>>I try to avoid functions in microsoft.visualbasic ...
Some people try to go as far as removing the MS.VB from Visual Basic, but
since the compiler /itself/ makes use of some of the stuff in here (try
creating a VB.Net program that doesn't depend on this assembly!), it's a
pretty pointless exercise.
>>... because I want to learn the new way of doing things but frequently I
find the new way is longer and seems more confusing.
Agreed.
Anyone found the "new" way of 'ReDim'ing an array?

HTH,
Phill W.

Apr 24 '07 #13
Sorry David,

Now I know again I know were you stend for,

Cor

"David Anton" <Da********@discussions.microsoft.comschreef in bericht
news:0B**********************************@microsof t.com...
>I don't have a problem with Microsoft.VisualBasic (especially from VB
code),
but I'm just indicating the type of respone that some people will give you
if
you use it.
--
David Anton
www.tangiblesoftwaresolutions.com
Instant C#: VB to C# converter
Instant VB: C# to VB converter
Instant C++: C#/VB to C++ converter
Instant Python: C#/VB to Python converter
"Cor Ligthert [MVP]" wrote:
>David,

Pure Net approaches needs the Microsoft Visual Basic Namespace the same
as
the System.namespace.

That it is possible to work seperately on namespaces is one of the
advantages from .Net

Nobody will tell it there will be more namespaces in Net.

Cor

"David Anton" <Da********@discussions.microsoft.comschreef in bericht
news:47**********************************@microso ft.com...
You will find some opposition with people who insist on 'pure' .NET
approaches. Some very useful parts have no equivalent in the rest of
the
framework, such as the Financial class.
--
David Anton
www.tangiblesoftwaresolutions.com
Instant C#: VB to C# converter
Instant VB: C# to VB converter
Instant C++: C#/VB to C++ converter
Instant Python: C#/VB to Python converter
"cj" wrote:

Thanks to everyone for your responses. I'm glad microsoft.visualbasic
is still acceptable, I'll stay away from the Compatibility namespace
and
thanks for the tip on system.io.file.

cj wrote:
I am under the impression they are obsolete methods included for
backward compatibility. For instance is using
filedatetime("c:\myfile.txt") still the accepted way of getting the
date
c:\myfile.txt was last modified? I see filedatetime is in the
Microsoft.VisualBasic namespace. Is there some

dim file as new something
dim lastchanged as date = file.datetime

method we are supposed to use now?

If so what would make it better than
filedatetime("c:\myfile.txt")???

I try to avoid functions in microsoft.visualbasic because I want to
learn the new way of doing things but frequently I find the new way
is
longer and seems more confusing. Like my example filedatetime().
It'll
do what I need now but should I look for something else???



Apr 25 '07 #14
Reading this post made me think of chocolate and beer. I'm not sure why!

"Cor Ligthert [MVP]" <no************@planet.nlwrote in message
news:%2****************@TK2MSFTNGP03.phx.gbl...
You mean that in the BeNeLux would exist in future only Netherlands way of
life, because the other countries are obsolete. In my idea are the Belgian
and Luxenburg cultures full part of it. Like the MicosoftVisual Basic
namespace is in the Net.

Cor


Apr 25 '07 #15
David Anton wrote:
"Anyone found the "new" way of 'ReDim'ing an array?"

Actually, you can use Array.Resize (the behavior is identical to ReDim
Preserve, but it's limited to single dimension arrays). But ReDim Preserve
still works fine.
Ah! Finally!

New to /'2005/ though, and I'm still trudging around with '2003.

Maybe one day ...

Many Thanks,
Phill W.

Apr 25 '07 #16
Phill W. wrote:
David Anton wrote:
>"Anyone found the "new" way of 'ReDim'ing an array?"

Actually, you can use Array.Resize (the behavior is identical to ReDim
Preserve, but it's limited to single dimension arrays). But ReDim
Preserve still works fine.

Ah! Finally!

New to /'2005/ though, and I'm still trudging around with '2003.

Maybe one day ...

Many Thanks,
Phill W.
You can easily do the same in framework 1. Just create a new array and
use Array.Copy to copy the values from the old array. That's how
Array.Resize does it.

--
Göran Andersson
_____
http://www.guffa.com
Apr 25 '07 #17

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Shaun | last post by:
I have read a number of resources that explain that the MyServices found in VB.NET2005 can be used in C# by adding a reference to Microsoft.VisualBasic.dll and then using the...
2
by: darrel | last post by:
I've built a control. At the top of my control, I have this: Imports Microsoft.VisualBasic Then, later, I call a function like this: DateTime.Now.Year.ToString() This works fine on my...
15
by: Phill. W | last post by:
Is anyone writing VB.Net (2003) code /without/ referencing the Microsoft.VisualBasic namespace(?), regardless of whether its Import'ed or not? The Powers That Be here are trying to introduce a...
14
by: frostalicious | last post by:
Used VB.NET (on my client PC) to convert VB6 executable to .NET executable. Placed the .exe file on a network drive on my server. From client, ran .NET Wizards "Trust an Assembly" to make the...
2
by: Steve | last post by:
Having only recently migrated across from VB6 to VB.NET I'm still unsure whether or not I should be making (heavy) use of the Microsoft.VisualBasic namespace in new applications. I've read a lot...
34
by: Craig Buchanan | last post by:
Which vb.net object is the best match for the vb6 collection class? Specifically, I would like to be able to access the Item property with an index or a key string. I wrote my own class that...
8
by: Dave | last post by:
I'm trying to import Microsoft.VisualBasic to use the IsNumeric function in my C# code but all I see is: Microsoft.VisualBasic.VBCodeProvider while using Intellisense... From samples shouldn't...
1
by: Tom Kearney | last post by:
Hi - I'm trying to use "Microsoft.VisualBasic.Logging.FileLogTraceListener" from a set of C# aspx web pages, but I can't seem to use: <%@ Import Namespace="Microsoft.VisualBasic.Logging" %> I...
6
by: =?Utf-8?B?R3JlZw==?= | last post by:
I have two questions with regards to the LEFT function. I ran into a problem with the LEFT function today. I knew it was a valid Function, but when I tried to use it, it was getting interpreted...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.