Simple Code In Vb To Open / Close USB Port (Windows 7)?

Jun 11, 2011

I need to simple code in Vb.Net for Open / close USB Port (Windows 7) ...

View 7 Replies


ADVERTISEMENT

Cant Close Form With Serial Port Open?

Jul 8, 2008

I have a programme that accepts data from a serial port. If I close the port and then the form no problem. However if I try to close the form with out closing the port it appears to hang. I have tried closing the port in the forms close event but this did not solve the problem.The data recieved event is as below and UseData is the private sub which actually handles the data. Usedata contains the code line Dim InputText As String = SerialPort1.ReadLine
Private Sub SerialPort1_DataReceived(ByVal sender As System.Object, ByVal e As System.IO.Ports.SerialDataReceivedEventArgs) Handles SerialPort1.DataReceived

Me.Invoke(New myDelegate(AddressOf UseData), New Object() {})

End SubI am aware that this event runs on another thread and I have seen but cannot now find information about closing multiple active threads.or do I have to "uninvoke" the delegate

View 1 Replies

Auto-start Code On Open Then Close After Code Is Done Running?

Feb 15, 2009

I have a program that runs some code when i click a button on a form when done running the application ends. I want to automaticaly run the code when the users clicks on the exe. I have put the code that i want to run in the startup forms load event but that doesn't start

View 2 Replies

Open Port 433 In Windows?

Apr 1, 2010

how can i open port 433 in my windows

i don't want any code just i want to open open it

View 2 Replies

Open The Specific Port Of A Windows Computer?

Jan 15, 2010

I tried to make a winsock program.But when i run, i have a SocketException "No connection could be made because the target machine actively refuse it."Any suggestions on what i should do? Im using 17477 port.By the way Im using my own computer to test it. So i have no idea why.How should I open this specific port in my own computer?

Is it possible that I could include it to could into my program so that i don't need to open the ports of each computer? Below is my code.

[Code]...

View 6 Replies

.net - Can't This Code Open A Serial Port?

Sep 1, 2010

Public Class my_class Dim WithEvents COMPort As New System.IO.Ports.SerialPort

Public Sub FindReader()
Dim ports As String() = IO.Ports.SerialPort.GetPortNames()
Dim port As String
For Each port In ports

[Code3]...

When it runs, it shows a single COM port "COM1". I am assured that the device attached to it is a standard 8,n,1 and uses 9,600 baud. The exception is "Acess to the port 'COM1' is denied".

View 1 Replies

Open And Close Windows Explorer By .net?

May 30, 2009

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 Replies

Why Does Code Cause Open Excel Files To Close

Jun 25, 2009

Here is the problem: I have written an application that opens an excel file, copys a chart to the clipboard, then closes the excel file. It works fine except under a very special condition. If the user has an excel file open and then runs my application, the open excel file closes. To make this more confusing, if the user then reopens an excel file and runs my application again, everything works fine. It will continue to work fine untill the user reboots his or her computer. Then it will occur again one time

Here is the section of code I found the problem is in:
Private Sub Get_R1C1_Image() 'Gets excel data to display
Dim objXLS As Object = CreateObject("Excel.Application")

[code].....

View 7 Replies

Close() Puts Forms Into Crazy Open/Close Loop?

Mar 4, 2011

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 Replies

Get FullName From Available Serial Port (Com Port) From Device Manager In Windows Form With .net?

Jul 25, 2011

I have a Windows form.in windows form have a combo box that give me a list of available port serial with it code (Dim ports As String() =SerialPort.GetPortNames())for example( Com1,Com8,Com15,...).but I want to give me fullname of serial port in device manager for example in dvice manager is these (Comunication Port(COM1) - Printer Port(LPT1) And USB Serial Port(COM8)).how to Get it?

View 2 Replies

Post A Simple Code Using VB That Start Building Simple Games?

Jun 10, 2011

Is there anyone can post a simple code using vb,that start building a simple games ?

View 2 Replies

Code To Make Windows Open A Program At The Startup?

Aug 21, 2009

what is the code to make windows open a program at the startup?

View 4 Replies

Close A Usb Port?

Feb 8, 2011

How can one close the usb port (shut off power (electric current)) ?

View 8 Replies

Close Windows Calculator In .net 2008 When Application Close?

Aug 30, 2009

how to use windows calculator in vb.net 2008?

use System.Diagnostic.Process.Start(calc)

its working but i want when application close it also close this calculator how?

View 3 Replies

Communications :: Parrallel Port Simple Input Read?

May 9, 2010

What i want to do it be able to read the input of a pin on the parrallel port. I want to supply a constant voltage to the pin and when that voltage drops i want to jump to another procedure.

View 2 Replies

Dead Simple Example Of Sending Hex Data To A Serial Port?

Jul 6, 2011

I ran into this problem while trying to write a Pan/Tilt/Zoom controller program. I found some very complicated examples, but managed to put the pieces together into this simple test program.I first import System.IO.Portsthen I define a new serial port and give it the required parametersI open the com port when the form loadsI have two working buttons, one to pan left, one to stop panning. The hex commands are pre-configured.The one for Stop is A0 00 00 00 00 00 AF 0FThe one for Pan Left is A0 00 00 04 14 00 AF 1FI declare a byte array to contain the command bytes and put them into the correct position.

Code below:
Imports System.IO.Ports
Public Class Form1

[code].....

View 13 Replies

VS 2008 Open And Close Connection Every Second, Or Keep It Open All The Time??

Oct 21, 2009

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 Replies

Close Serial Port After Data Received?

Feb 22, 2009

I have the following code that listens to a serial port and writes the incoming data to a listview control (the serial data are a delimited string taht arrives once per second that I parse into separate listview subitems). I would like to be able to close/disconnect the serial port once a specific value in the incoming string is detected. For example, in this case one of the columns of data in the incoming string represents depth, I would like to close the serial port when the depth falls below a given number. I have tried the code below, but my program crashes on the SerialPort.CLose method.

dim m_strOBS() as string
Private Sub SerialPort_OBS_DataReceived(ByVal sender As Object, ByVal e As System.IO.Ports.SerialDataReceivedEventArgs) _

[code].....

View 4 Replies

Communications :: Close Serial Port After USB Device Unplugged?

Oct 1, 2009

There seems to be a lot of discussion around about handling exeptions when a USB serial port device gets unplugged. What I want to know is how can one re-attach to it once it is plugged back in. The problem is that if you unplug a USB serial port device the app doesn't know it has gone and remains convinced it is still open. I have to close the app completely before I can re-attach to the device. I need a way to force it to close/go away.

View 2 Replies

Checking If A Port Is Open - If It Is Open Then Return True, If It's Closed, Return False?

Dec 28, 2010

I'm making a Visual Basic GUI application to display whether a number of my ports are open for people to know whether things like my website and my Minecraft server are open.My problem is I have absolutely no idea how to do this in Visual Basic.Basically, I'm asking for something which sends a signal to an IP with a specific port, if it is open then return true, if it's closed, return false. Similar to: http:[url]....

View 1 Replies

C# - Open And Use A TCP Port?

Jan 17, 2012

I need to transfer data between several computers in a network using my app. I thought of using TCP ports. how to open and use them? I only want to make a file transfer and chat app that works offline.

View 3 Replies

Serial Port Example Code - Connect To A Modem Thru The Serial Port

Oct 26, 2011

The link below has code to connect to a modem thru the serial port but it is for an earlier version of VB. when I convert the code, it does not fully convert and has 4 errors that prevent building the project. can someone tell me what needs to be changed or added?

[URL]

Note: the error: not CLS-Compliant

View 8 Replies

Cannot Apply Simple VB Code As Service Code

Mar 6, 2011

I am currently writing a program in Visual Basic 2008 express edition to read and write to tags on an Omron PLC. I am using the DeviceXPlorer OPC Server V4.1.1.1 program to connect to the Omron PLC. I have made two programs, one is a form program which works fine, two is a windows service program where it does not let me connect to the OPC Server. The connection code is identical, the only difference is the windows service code is called by a timer. The timer works fines and jumps into the connection code, but stops at the line

[Code]...

View 3 Replies

Open All Serial Port?

Jun 9, 2011

how to open all serial port in vb.net? i know how to open by getportname..but how to open all??can we do it?

View 2 Replies

Send A Simple Binary String To A Printer Port Such As "00000011"?

Jul 3, 2009

I need to be able to send a binary string such as 00000011 to a printer port using visual basic.

View 14 Replies

VB Code Using Com1 Port - VB6 | Dream.In.Code?

Mar 13, 2012

actually this is not an vb.net code belongs to vb..i have written it for getting the data from com port 1.but i dont know what data the com port is getting..

Dim Lng As Long
Dim lpPoint As POINTAPI
Dim X, Y As Long

[code].....

View 5 Replies

Simple 'open Cd Tray' App Not Working One One Computer

Jul 4, 2010

I have a simple executor that when clicked, opens the CD tray.[code]On my computer it works fine but on another computer, it only opens the CD tray if there is no disk in it.[code]

View 5 Replies

Can't Open A Serial Port For Reading?

Aug 10, 2009

I am trying to open a GPS device on a serial port but no matter what I try I just keep getting an IOException. This is on a pocket PC BTW.

[Code]...

View 2 Replies

Check If A Port Is Open On A Particular IP Address?

Nov 24, 2011

I have an application which need to send data to particular system on specific port. But the application gets hang if the target system port is closed.

I Want to know if a particular Port is open on a specific IP address so that i can continue my next task. PBL (Visual Studio 2010 Ultimate)

View 11 Replies

Check If A Port Is Open Using Sockets?

Feb 16, 2010

I have written some code to check if a port is open. I'm currently trying to work with the system.net.sockets name space.I know that the easy way out would be to use AxWinsock, but I don't think the AxWinSock is very cool, nor do I think it's very professional when trying to make network applications in VB.NET.

I've got this Error message : Socket Exception Was unhandled, No connection could be made because the target machine actively refused it 127.0.0.1:1 IDK, Like I said, I'm new to the System.net.sockets namespace, I'm pretty good with other stuff in VB.NET, but when it comes to the serious stuff like the system.net.sockets namespace, I'm not so great.look at this code and tell me what I am doing wrong, I've manged to get this far, and I don't want to just give up and continue watching my movie.

[Code]....

View 3 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved