Open "LPT1" For Output As #1
Apr 30, 2009I would like to know how can I print directly to the printer port from VB.NET. it is possible in VB 6.0 by this command
Open "LPT1" for ouput as #1
but it doesn't work in VB.NET
I would like to know how can I print directly to the printer port from VB.NET. it is possible in VB 6.0 by this command
Open "LPT1" for ouput as #1
but it doesn't work in VB.NET
I want to print some strings to LPT1 printer, but i dont find the way in VB2010 In earlier VB6 a use this method :
Sub PrintZPL()
Dim f As Integer
f = FreeFile
Open "lpt1" For Output As #f
Print #f, "^XA"
Print #f, "^PRC"
Print #f, "^LH0,0^FS"
Print #f, "^LL114"
[code]....
How can i do this thiong in VB.NET It's a Windows app not a web?
how i can print a text file to lpt1.
View 2 RepliesI am writing a POS application using vb.net 2003 and need to print 3 or 4 lines of information (complete with formatting instructions) to an attached parallel printer. Here are the specifics:
1.Printer is a Practictical Automation CLTX2003 parallel thermal printer
2.Formatting instructions accomplished using Friendly Ghost Language (FGL)
3.No dialog boxes should open for user confirmation or input
4.Would prefer to print each line (with its formating instructions) directly to the printer
I have a little program made by my in earlier VB6 to print some labels to lpt1 printer Now in VB2010 i want to send a string to lpt1 to be printed but i cand find the way I have this string and i want to copy to lpt1, how please
'Dim labelPrint As String = "^XA^PRC^LH0,0^FS" + _
' "^LL114^MD0^MNY^LH0,0^FS" + _
"^CWI,E:ARIAL.FNT" + _
[code]....
I have a fairly old radio receiver. (Icom R70) A friend and I have built an interface to control it from my computer. The interface is parallel. For me the interface is a black box. (My friend is the electronics specialist) In the description (25 years or more old) the statement to set a frequency and receive mode (like Am, FM etc) on the receiver is:print ".0:087330"
Today I am working in VB.Net and on Windows7 pro. I have already spent several days figuring out how to do this, but can't get it to work.I have found inpout.dll, but that does only allows me to write one byte at the time, and if I break up the above string and send nine individual characters, it does not work.
find a way to check if a file exist before opening it or creating it.I know how to open a file for output or input or even append which is what is going to do assuming it exist already.
'all this is inside a button which will open the file upon pressed
'to populate a
'combo box drop down list[code]....
I have already updated 90% of some code that i have 1 day to do but i dont know how to do this.
Open "c: empimport.iif" For Output As #1
Print #1, "!TRNS" & vbTab & "TRNSTYPE" & vbTab & "DATE" & vbTab & "ACCNT" & vbTab & "AMOUNT" & vbTab & "MEMO" & vbTab & "ACCNUM"
Print #1, "!SPL" & vbTab & "TRNSTYPE" & vbTab & "DATE" & vbTab & "ACCNT" & vbTab & "AMOUNT" & vbTab & "MEMO" & vbTab & "ACCNUM"
[code]....
I have another chunk of VB6 code that seems to need some workaround for .NET. For a shortened version, this is all it is doing:
[Code]...
And so on, and so forth. You can see it keeps repeating itself to create new lines. The question is, is how do I implement the same thing in .NET?
What I am trying to do: There are three powershell scripts with different time delays as shown below.I am trying to run them asynchronously in .NET and I followed this article to implement Asyncrhonous programming. Where I am stuck:The I am not able to retrieve output after the events are invoked.The scripts are being called but then the program ends and it shows "Press any key to continue" in console windows.I don't what I am missing here.
Info: JobRequest is a class that I use to pass around information keep track of jobs.
Sub Main()
OurAsyncFunctionCalling("psDelayScript2.ps1", "-arg1 4 -arg2 5", 1)
OurAsyncFunctionCalling("psDelayScript1.ps1", "-arg1 2 -arg2 3", 2)[code]......
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Microsoft.VisualBasic.Interaction.Beep()
System.Diagnostics.Debug.WriteLine(3 + 2)
End Sub
Why I don't see in Output window number 5 as output?
I'm just going to throw all my code in here in case there's something wrong with a piece of the code not in the "SelectName()" sub.
Module Module1
Dim selectednames As String = ""
Dim index As Short = 0
Dim inarray As Boolean = False
[code]....
Here's an image of what it does (I suppose you can see what went wrong)13 inputs, 3 outputs expected, only 1 output given.As from what I've figured out so far, it's doing the correct amount of loops etc. It's just as soon as it starts generating the "winner" for the 2nd game key it doesn't get a string value from namesarray.Also, why is
For x = 0 To totalnames - 1
Debug.Print("namesarray(" & x & ") = " & namesarray(x))
Next
not giving me a debug output?
im using Trace to trace and debug my Application which works fine. Now i wanted to output my Trace Information to a text file like below:
Dim c As Integer = Console.ForegroundColor
Dim ts As TraceSwitch = New TraceSwitch("SPMassUploader-TraceSwitch", "")
Dim tw As New TextWriterTraceListener(Now.ToString("yyyyMMddHHmmssfffffff") & "-" & "output.txt")
Trace.Listeners.Add(tw)
[code]....
Private Sub LinkClicked(ByVal sender As Object, ByVal e As EventArgs)
Dim link As HtmlElement = WebBrowser1.Document.ActiveElement
Dim url As String = link.GetAttribute("href")
[code]...
Okay so here's the question how do I get the links that open in a new window to open in my main webbrowser control. The above code does some, but it's not fool proof.
I want to open up an existing instance if my program is already running only if its running the same version.I noticed that this question was asked for only if the name exists, but what if the version is older, I just want to notify the user that an older version is still running, "please remove older version before starting this version."The other link is this one:Return to an already open application when a user tries to open a new instance but they don't talk about closing an instance if an older or newer version is detected.
View 3 RepliesWhy would a .sln solution file open and appear empty in Microsoft Visual Basic 2010 Express - i.e. no windows showing projects and code files etc.When I inspect the file in a text editor, it contains references to vbproj files (which are present) which indicate that it should not appear as empty.No error messages are reported when the file is opened.
View 2 RepliesI would like to open the excel file after create the excel file. The creating file function is done, but the system unable to open the excel file. My coding as below:
Dim xlApp As Excel.Application
Dim xlWorkBook As Excel.Workbook
Dim misValue As Object = System.Reflection.Missing.Value
[code]....
I want to open up an existing instance if my program is already running only if its running the same version. I noticed that this question was asked for only the the name exists, but what if the version is older, I just want to notify the user that an older version is still running, please remove older version before starting this version. The other link is this one: Return to an already open application when a user tries to open a new instance but they don't talk about closing an instance if an older or newer version is detected.
View 1 RepliesI've noticed that when you click on a web page in Windows Explorer, or open a file in general, and the default application to open it is internet explorer, ie opens and opens the file. However, when I tried this on my Web Browser it opened, but ignored the file and went on its usual routine. How can I get my Web Browser to open and open the file that was clicked on in explorer?
View 1 RepliesMay i know how to code to enable users to drag picture into the picturebox and be able to open the picture automatically once the user let go of the mouse click event, but if the user leave up the mouse click button on the main form then a msgbox will pop up saying this is not the correct place to put in the picture and the form will not be able to open the picture.
[Code]...
I saved a file with the extension .doc. I use the RichText to write and save the text. I did not set any encoding type when I saved it. When I tried to open the file in the Richtextbox again, I got all the formatting characters in the RTF file. How do I correct this? How do I open and re-open a .doc file in the Rich Text box control without the formatting showing up in the box with the document contents?
View 4 Repliesim having a slight problem with my open file dialogue box, i need to be able to open the dialgue box, and click the file and open in my pdf reader, or at least load it to my other form ive created. what ive go so far:
[Code]....
Questions regarding progress bars. to start i would like to say what i am trying to do: i am trying to have my app open a save confirm message box open. at this point if the user presses ok then a seperate form will open containing a progress bar to visually represent the status of the file saving. the following code is written in VB 2008
The following code says that if the ok button was clicked then show the form with the progress bar
CODE:
Now this is the code that performs the actions of save... but i am getting an "IOException handler error" saying that the proccess is in use
CODE:
In my program, I have a timer with a inteval set to 1000ms. The timer is executing a MySQL-command, and right now I'm opening and closing the connection each time.
View 5 RepliesI'm try on Ultimate version and Express version. Reinstall many time from web install and offline install. What should I do ?
View 10 RepliesI like to open a file. The open option should be shown in a separate window. My code works fine but the open window is not displaying to open a file. Here is the code:
private void OpenMyFile()
{
string path = GetPath() + ViewState["fileopen"];
[Code]....
how can i create an output like "picture 2" instead of getting output "picture 1"
[Code]...
Currently i'm opening childforms like this:
Dim backupform As backup
backupform = New backup()
backupform.MdiParent = Me
backupform.Show()
MenuStripFix()
backupform = Nothing
How can I make it so if the menubar is clicked and if the childform is open, the open childform is showed and not a new one.
I am a beginner using Visual Basic 2008 express and trying to get a folder to open if it isn't already, and if not then maximise it. Here's my
[Code]...
I am making a browser and i have putted tabs in it too. But when i click "open in new window" in my browser the internet explorar pops up. I want my browser window to pop up. Secondly the "open in new tab" option is not avaliable when i right click a link. How to make it avaliable and the new tab should open in my browser(not internet explorar)
View 2 Replies