Please help with this issue
Hi !
VB Code:
Open "LPT1:" For Output As #1
Print #1, "Hello!!"
Close #1
Above code prints data to LPT port. it works fine in vb6. Later on i upgraded that project to VB.Net which converted above code into following:
VB Code:
FileOpen(1, "LPT1:", OpenMode.Output)
PrintLine(1, "Hello")
FileClose(1)
Now this code is not working in VB.Net. It shows the following error, what that means :(
error message:
An unhandled exception of type 'System.NotSupportedException' occurred in microsoft.visualbasic.dll
Additional information: FileStream was asked to open a device that was not a file. FileStream's constructors that take a String will only work with devices that are really files. If you need support for devices like "com1:" or "lpt1:", then call CreateFile yourself then use the FileStream constructors that take an OS handle as an IntPtr.
Please help me with this issue:(