Hi !

VB Code:
  1. Open "LPT1:" For Output As #1
  2.     Print #1, "Hello!!"
  3. 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:
  1. FileOpen(1, "LPT1:", OpenMode.Output)
  2.     PrintLine(1, "Hello")
  3. 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