How To Enable / Disabling USB Port
Jul 17, 2006
I am creating a VB6 program in which I need to Take Backup of Data to USB (Thumb dirve). But for security purpose USB port must be disabled always. So when I start taking backup I need to enable the USB port take the Backup and disable it. How to do that using VB6? I have tried the option to enable using Wscript as follows. But it is not refreshing the USB port automatically.
Set objReg = CreateObject("Wscript.shell") objReg.Regwrite "HKEY_LOCAL_MACHINESYSTEMCurrentControlSetservicesUSBSTORStart", 3, "REG_DWORD"
Is there any way we can refresh the Windows devices from VB6 ?
View 3 Replies
ADVERTISEMENT
Jul 15, 2009
I am developing an application with a DataGridView (dgvData) that requires a ToolStipMenuItem (tsmiSelectNetwork) of a ContextMenuStrip (cmsNetwork) to be enabled and disabled programmatically based on if the column is sorted or not.
I have set:
'tsmiSelectNetwork.Enabled = False' at runtime
'tsmiSelectNetwork.Text = Select All' at runtime
'dgvData.Columns(5).ContextMenuStrip = cmsNetwork' programmatically
When dgvData is sorted by column 5, tsmiSelectNetwork.Enabled should be set to True; when it is sorted by any other column, it should be set to False (see code below)
Private Sub dgvData_Sorted(ByVal sender As Object, ByVal e As System.EventArgs) Handles dgvData.Sorted
If Not dgvData.SortedColumn Is Nothing Then
[Code]....
The debug output indicates it is functioning properly, but what you seen on the screen is not.
I am using Visual Studios 2008, version 9.0.30729.1 SP; and .NET Framework 3.5 SP1; ContextMenuStrip version 2.0.0.0
View 6 Replies
Jul 13, 2011
I'm doing my dev work on a Window 7 x64 machine, deploying to a Windows 2008 x32 server. At the moment I'm adding WCF services to some internal apps so that we can build smaller clients using net.tcp bindings that report to the user what the server is doing without running multiple instances of the server. To cut back on how much administration the apps will require, I tried enabling port sharing on my first server app. I'm using the app to self-host the WCF service so they can be easily moved from one server to another if necessary. Here's the code starting the server:
Dim _service_host As ServiceHost
Dim active_server_address As Uri = New UriBuilder("net.tcp", "localhost", CInt(My.Settings.ServerPort)).Uri
[Code].....
I get the following error when I put a breakpoint at the last line: Unable to automatically step into the server. Connecting to the server machine 'nettcpportsharing' failed. The requested name is valid, but no data of the requested type was found. The Try...Catch block housing that code says the exception type is AddressAlreadyInUseException...but when I run netstat I don't see anything else listening on that address. There's no occurrence of 'nettcpportsharing' anywhere in my solution. I've checked to make sure that the Net.Tcp Port Sharing service is started.
View 1 Replies
Mar 14, 2011
how to enable or disable USB port of a system with windows-07 or XP
View 3 Replies
Jun 19, 2009
I want to allow the user to enable or disable a textbox by clicking either a button (enable) or the reverse. (disable) if the user clicks the enable button the textbox should receive the focus.
View 4 Replies
Nov 27, 2010
I'm mohammed from Oman ,I'm visual studio.net programmer How I can Read the Data From Barcode Weight scales By Serial port and TcpIp port
View 7 Replies
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
Jun 9, 2010
I would like to detect the Address and Port number of the Parallel Port in computer.
View 4 Replies
Aug 2, 2011
If I uninstall the COM1 and reboot, it works. If I shut down (power off) and restart, I get the message below. If I uninstall then click on Scan for Hardware Changes,The given port name does not start with COM/com or does not resolve to a valid serial port. Parameter name:portName
View 8 Replies
Oct 20, 2011
I am trying to get my 4 port USB relay board to work in VB.net using the COM PORT. I found some code from a poster who has the 16 port USB relay version. When trying his code i can only get it to turn on relays 1-3 all at the same time. The product can be found here: USB 4 port relay
"01+//" - Relay 1 is switched ON
"01-//" - Relay 1 is switched OFF
"02+//" - Relay 2 is switched ON
"02-//" - Relay 2 is switched OFF
[code].....
So i am confused as to how to separate each relay out with that code above and just be able to turn on any number 1-4 relay on or off independently from each other!
View 1 Replies
Oct 20, 2011
I am trying to get my 4 port USB relay board to work in VB.net using the COM PORT. I found some code from a poster who has the 16 port USB relay version. When trying his code i can only get it to turn on relays 1-3 all at the same time. The product can be found here: USB 4 port relay I was following what the guy in the post was doing to turn his on:
[Code]...
View 6 Replies
Oct 15, 2008
Im having problem with the Serial Port. When i run my program, "Access to the port 'COM1' is denied". What does that mean? Im not sure whats happening because theres no error in my code. Someone suggest me to use 'COM2'. Which is also the same result. I have a microcontroller, programmed and run it. And i need to capture the data onto my vb, which is on a multiline textbox. How to i do that?Just to double check my code?
[code]...
View 1 Replies
Apr 12, 2009
I'm having a problem when i try to disable the windows key in my (VB.Net 2008) App. I tried to use
If e.KeyData = Keys.LWin Then
MsgBox("Incorrect key pressed", MsgBoxStyle.Exclamation)
e.Handled = True
[code].....
View 13 Replies
Aug 26, 2009
How do I disable CTR+C in a richtextbox?
View 1 Replies
Nov 5, 2011
Private Function StoreCouponCode() As String
Dim con As New SqlConnection(ConfigurationManager.ConnectionStrings("DBConnectionString").ConnectionString)
[Code]....
When the user clicks on the CmdGetCoupon it takes some time to redirect..so the user clicks on the CmdGetCoupon more than once,which results in multiple coupon generation from a single user account.
I want to display a message "Please Wait While Your Coupon Is Being Generated" and disable the CmdGetCoupon so that the user cannot click multiple times
View 3 Replies
Dec 31, 2010
Is it possible to make the viewstate false of whole page including all controls at a time.I mean I don't want to set enableviewstate="false" for all controls..In the page directive of the aspx page I have made enableviewstate="false" but still viewstate of all the controls of the is enabled.. And what the EnableViewState="False"actually works within Page directive.
View 3 Replies
Apr 7, 2010
I've used (buttonName).enabled = false to disable buttons when the user clicks on them but I don't like how the button becomes faded.
Is it possible to disable a button without changing the look of the button?
View 7 Replies
Apr 14, 2009
I have got my login form set up for my inventory system. User(admin) with access level 1 will be directed to form 1 and user(normal user) with access level 2 will be directed to form2.
[Code]...
View 5 Replies
Sep 11, 2010
Working the first time with a CheckedListBox.
Question: is it possible to disable an item of the box so you can't change the value of the checkbox.
View 1 Replies
Mar 1, 2009
Take the following fundamental code:
Private Sub btnStop_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnStop.Click
btnStop.Enabled = False
'Lengthy code procedure
btnStop.Enabled = True
End Sub
I've just notice that when I click on a button, and try to disable it in order to avoid the user clicking on it several times during process (or disable the entire form for that matter), the application somehow records the subsequent clicks and processes them after the button has been re-enabled. But that's not the behavior that I want at all. I just want to disable any user interaction with the button (or the form perhaps) until processing of the Button_Click event is completed. How can I do this?
View 19 Replies
May 9, 2009
I am attempting to make a web browser But I want it so it will not download any images And just show text and forms to save time on loading. I have found some things on how to do this but its all in C#
View 3 Replies
Sep 13, 2010
Busy with a checklistbox we want to know how to disble an item.
View 4 Replies
Mar 5, 2009
I want to disable some items in the Combobox. Is there a way to do that ?
View 1 Replies
Sep 8, 2008
is there a way to disable keys on a keyboard?
like the windows key?
View 9 Replies
Jul 12, 2011
I want to add something to my project and i want to disable mouse but without a timer. I want to enable it back again with press to keyboard. Is there code to do it so?
View 6 Replies
Mar 1, 2010
how u can disable the X(close) option on a form in VB?? i dont want the user to be able to close the form that will be running and need to disable the X to be able to do this.
View 5 Replies
Apr 28, 2010
The instructions I'm following indicate that when user clicks the Add This Item menu item for a new order, the customer information should be disabled so that the state cannot be changed until the next customer.I've tried to validate that all the customer information fields are filled when user clicks Add This Item menu item. The trouble I was having was that even when you were alerted that you didn't fill one of the fields, you clicked on the message alert and then the customer fields were disabled before you could fill the empty one.
I've tried to make an if statement which checks if some are empty to alert else if they are filled then disable. This doesn't work either. I get Conversion from string "" to type 'Boolean' is not valid. I'm not advanced enough to understand this. I just know boolean means true or false or yes or no. I'm not sure the best way to handle this situation. I don't even know if locking the user out is wise since they might have wanted to correct something wrongly entered but my instructions are to validate that the fields are filled and then disable the customer information. I need to follow the instructions exactly.
This is what it looks like:
Private Sub AddThisItemToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AddThisItemToolStripMenuItem.Click
'Declare local level variables.
Dim Quantity_Decimal As Decimal
[code]....
View 8 Replies
Jun 6, 2011
I am creating a USB "cookie dispenser" (long story) and I plan on programming it by, when cookie.exe starts, it disables the port, you plug the USB in and press a button and it enables the port (thus powering the device). What I need to know is, is this at all possible? And if so, can you help me get it to work? I know I should put in an effort but it's late for me (UK) and I want to post this overnight so that you guys (in the USA may
View 8 Replies
Apr 12, 2011
I am enrolled in a class in Visual Basic 2008. I wanted to drop the class, but it is too late. Now, I am stuck with this project that the professor assigned and it's due this Thursday. Anyway, how do I do this: The credit card number TextBox control is dynamically enabled/disabled depending on the choice of payment type? And did I do the newOrderButton correctly (see code below)? This is also the clear button. And is there a way to do a reset Form? Sorry for that many questions. I am really lost right now because there is a lot to do in this project and I don't even have a clue of how I am going to finish this project.
Private Sub newOrderButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles newOrderButton.Click
' clears all the information that is displayed and start over
[code]......
View 6 Replies
Sep 18, 2011
I have a program and I need the Submit time button to be disabled after I enter 5 numbers and then the Get Payment button needs to be enabled. I have been playing around for several hours but cannot figure out how to do it.[code]
View 4 Replies