Open And Close Com Ports In .net?
Jan 5, 2010i want to open and close com ports in vb.net and send data through ports.
View 2 Repliesi want to open and close com ports in vb.net and send data through ports.
View 2 RepliesI am making a VB .NET application using Visual Studio 2010. I want to know how to open/close ports of the computer. The application will be running in Windows XP only.Actually the thing I want is to close all ports but 80 but also have the ability to open a few more if I need them. Any ideas?
View 16 Replieshow do i detect for open ports? if the server close the port, the client will have to respond with msg("PORT IS OPEN")
View 5 Repliesable to open and utilize a single serial port within with my VB 2008 program (i.e., set port parameters, open&close port, send&receive data via port, etc.), but I want to open two or more serial ports concurrently within my VB 2008 program so that I can read data from one port, say COM1, make decisions and calculations based on that data, and send instructions out through another port, say COM2.
View 1 RepliesLets say i got a listview and that listview contains ip and open port, i wan't the form to search open ports and put them in the Right lisview/Column example : messagebox("Ip Found")
Here is what i have a.t.m
CODE:
In a program I'm working on, I want a "Loading..." dialog to close when it can't log in to a site using the username and password provided by the user. Basically, I have the code set up right because the function it is supposed to carry out when that occurs does work, but for some reason it ends up in some really weird stuff happening. In the Loading form, I have it set to do "Form1.Show()" and then "Me.Close()", assuming it would simply show the login form and then close the Loading form. However, when this happens, the Loading form closes, and then for only an instant Form1 shows, and then the Loading form shows and Form1 closes. This happens forever until I stop the debugging, and I can't seem to figure out why. Am I using the wrong method? What exactly does Me.Close() do anyways? All I want to do is close the form and open another
View 5 RepliesI was wondering if its possible for VB to display all available COM ports that are open. he reason that I ask this is because this program will be run on various computers where the COM port will not always be the same. I have a text box now that the user can choose which com number he/she wants but if the wrong one is entered, the program crashes rather than displaying an error message. It would also be nice for the system to show which available com numbers there are
View 5 RepliesIn 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 Repliescan't close open image
View 10 RepliesI would like to close my appliaction and then open it based on a condition.Lets say I have a Lab1.EXE file, I want to close if the flag = True and then reopen it.
If ClFlag = True then
Application.Exit
---Then
RUN LAB1.EXE
Endif
I never had problems with this before but now this ain't working right. What I want to do is open a new Form and close the Current Form that is already open. This code use to work for me
View 5 RepliesI want to close form and open another one without termination of the application, when I try to open second form and close first one the application terminate.[code]...
View 2 RepliesWhen I open my application I have the first form which opens as the Register form. When I press the Activate Button I want the MAIN form to open and I am using the code below as the last two line[code]...
View 5 RepliesI'm developing a WinForms app in VB.NET, that handles sets of style data, and when the user clicks on another set's label, it prompts through a dialog "You are leaving this style preset to edit another one. keep changes on this one? [Yes] [No]".But, I'm facing the problem that, when the user clicks either option, and the dialog closes, everything has to be refreshed, and loading the form again seems a good option.[code]But as soon as that sub is called from the prompt, it crashes the application. (doesn't show an error in debug, simply crashes) How should I, from a given dialog, close the dialog, it's parent, and re-open it's parent? (which triggers all the Dialog_Load() code of the parent)
View 2 RepliesAny code I could get that would Open + Close a .bat or .cmd file? Not ALL .bat / .cmd files that are open, but just ONE (runserver.bat / runserver.cmd).
View 1 RepliesIs it possible to issue a Open CD and a Close CD using VB.net? Are there any examples of code I could see or articles? Thanks for you help, in what seems to be such a trivial matter. (I know though that the simpler the function the more code seems to be
View 2 Repliesi have just started to use this program...i accidently opened more than 1 program and i cant close them.
View 1 RepliesIn this project I want to read text from the text file.. after that want to update the text file.. if i just run the code manually, the code run well.. but if I want use timer to keep the code run automatically there show problem.
here my code
Imports System.IO
Public Class Form1
Dim skrng As Date = Date.Now()
[code]....
SQL connections confuse me sometimes In almost every SQL related code on the internet the routine is like this;
* Open connection
* Execute SQL command
* Close connection
Is it good practice to just open a connection when the application starts and use that connection until the application closes?I know that sequential connections are required when processing more queries, but what if I need to poll a certain Table every x seconds? Isn't is better to keep that single connection open for as long as the application is running (and re-open when a failure occurs) instead of opening a new connection every x seconds?
Are there code can open and close forms in particular Time (reference is computer clock)..?
Example: in 08:00:00 open form1 and in 08:45:00 close it
And can I let the user enter the time to open and close the forms in the Basic Form?
I wanted to open a URL from my VB.net Application on a button click event (for sending SMS from my application). However, I don't want my users to know about it & I don't want to have a browser pop up and execute the URL.
View 7 RepliesI wanted to open a URL from my VB.net Application on a button click event (for sending SMS from my application). However, I don't want my users to know about it & I don't want to have a browser pop up and execute the URL.
Is it possible to do it invisibly? And once it is done, is it possible to close the invisible browser window too?
[URL]
I am having issues with people not closing an important file in excel.I have a new vb.net based application that i want to close the excel file when i prompt it to. The application checks for specific named files in a hidden folder on a timer event, (that all works fine) how do i tell it to close a file that is already open.All threads i have read say things like this:
Dim XLApp As New Application
Dim WkBook As Workbook = XLApp.Workbooks.Open("C:Book1.xls")
Dim Sheet As Worksheet = CType(WkBook.Sheets(1), Worksheet)
[code]....
I am trying to give some user entertainment, and show a "please wait" window, with Marquee, during the loading of a separate complex Window. I am attempting to do this by loading the Window in a new thread, like this:
Public Function ShowPleaseWait() As System.Threading.Thread
Dim PleaseWait As New System.Threading.Thread(AddressOf LoadPleaseWait)
PleaseWait.SetApartmentState(System.Threading.ApartmentState.STA)
[code]....
In the calling code, it calls ShowPleaseWait and saves the Thread for later.. To close the window, it calls Thread.Abort, on the saved thread. This in turn will causes it to enter the Catch. I have tried, many different ways, with and without the catch.This works incredibly, the first time it is called. However, additional calls will fail at window.Show() with the exception: The calling thread cannot access this object because a different thread owns it..This really puzzles me as the window was created one line above the call to window.Show and is local. How is it owned by a different thread? How can I fix this?
My cousin and I were discussing the difference between Java and VB.Net and I thought I would make a simple application to show him.
My form has two labels a numerical up and down component and a button.
I want to set it so when my cousin presses the button it will open and close his disk tray for the amount of time he chose using the numerical up and down.
I have tried making the program using a sample I have acquired but ti keeps throwing this error.
This is the error.
PInvokeStackImbalance was detected
Message: A call to PInvoke function 'WindowsApplication1!WindowsApplication1.Form1::mciSendString' has unbalanced the stack. This is likely because the managed PInvoke signature does not match the unmanaged target signature. Check that the calling convention
and parameters of the PInvoke signature match the target unmanaged signature.
I have an application that has multiple forms. The "main" form within this application can be accessed from other forms. However, each time this "main" form is accessed throughout the application, a "new" instance is created, resulting in multiple instances of this form being open.
I would like to have "only" one instance of this form open at one time. If it is currently opened, I would like it to be brought to the forefront, instead of opening a new instance.
I have use VB.Net 2005, I want to create an application , In this I want to open a windows explorer on a form load event and close this windows explorer when my application will close or on formclosing event .
View 14 Repliesi am developing client-server app. i want to hide the opened form and open the another form when i recive the commnd from server. the client side has two form and one class.code(this code execute when i recive the msg):
Sub messagerecieved(ByVal message As String)
Dim msg() As String = message.Split("|") ' if a message is recieved, split it to process it
Select Case msg(0) 'process it by the first element in the split array
[code]....
I need to open the previous form when i close the immediate form
View 5 RepliesI know it's asimple code but i cant remember. i want when my program closed then website open for the user for a site
View 2 Replies