Pavel,
The Microsoft.VisualBasic namespace has nothing to do with VB6, it is simply
a Net namespace like there is too Microsoft.Mshtml. This Net namespace add
some of the things which are a language part of VisualBasic but not standard
in in other Net program languages. There are not whatever plans to remove
this namespace ever from Net.
This VisualBasic namespace can be used within any Net program language like
any other namespace and are true Net without problems that they can become
forever not foreward compatible.
There is a VB6 compatible namespace Microsoft.VisualBasic.Compatibility.VB6
http://msdn.microsoft.com/en-us/library/microsoft.visualbasic.compatibility.vb6.aspx
This awful thing covers things like the use of com objects which are not
included in Net . This one is not planed to stay forever in the frameworks.
One of the methods in the Microsoft.VisualBasic namespace is the
filesystem.lineinput
http://msdn.microsoft.com/en-us/library/microsoft.visualbasic.filesystem.lineinput.aspx
I avoid using this in C# simply because of the fact that it makes my code
bad to understand for C# developers who don't understand VB.
(This lineinput statement I avoid everywhere, as I have found it forever an
awful piece of code, but that is of course just my preference)
Just to make this more clear because VB6 is not Net it is Com.
Cor
I need to convert some very old files that have been once created using
VB6.
Problem is, ReadLine() doesn't work like "Line Input" does.
Consider the following file:
1
"some info"
"more info"
"even more info"
"yet another
(multiline) info"
"yaddayadda"
The point of using quotes is that Line Input reads "yet another \r\n
(multiline) info" as one continous string whereas ReadLine() splits it
into 2 parts.
Are you sure? I'm fairly certain that "Line Input" just read lines as
is, and ignored any quotation marks and commas. Maybe you mean plain
"Input" (which does parse those things)?
Is there any option to make .net StreamReader aware of enclosing quotes?
No. You need to write your own parsing code for that.
However, there is an easy workaround. If the input is governed by VB
rules, then just use VB.NET compatibility class library (which you can
do from C# just as well). For that you need the FileSystem class in
assembly Microsoft.VisualBasic. VB6 "Open" statement corresponds to
FileSystem.Open, and "Input" corresponds to FileSystem.Input (and
"Line Input" corresponds to FileSystem.LineInput, in case you still
need that). It's likely that implementations of those methods
implement all quirks that might exist in VB6 input/output formats
better than you would be able to do on your own.