|
Thanks For The Advice,
My Main problem is i wanna create a login application that is for vb.net smart devices,cus i am totally new to vb.net smart device.
that code that i provide is the normal application i wan it to be the vb.net smart devices version. . .
maybe you can give some guide or like provide some source code for me for making the login system on vb.net smart devices.
Thanks
|
|
|
|
|
In the application I'm developing, I'd like to give the user the option to automatically start the application when windows starts. From my searches it looks like setting a registry key is one of the best ways to do it.
I haven't ever played with the Registry in my programs before (I've only ever manually edited the registry), so I want to make sure I get it right.
I came across MatrixCoder's article "Autorun Applications" which is quite clear and straight forward.
He uses the following sub and passes it System.Reflection.Assembly.GetEntryAssembly.Location for path in order to set the registry key.
Private Sub AddCurrentKey(ByVal name As String, ByVal path As String)
Dim key As RegistryKey = Registry.CurrentUser.OpenSubKey("Software\Microsoft\Windows\CurrentVersion\Run", True)
key.SetValue(name, path)
End Sub
If the key already exists, will this just overwrite it, or will it add another key each time AddCurrentKey() is called?
If it would keep on adding further keys, how would the code best be modified to check if the key already exists?
Regards
Paul Hasler
modified on Tuesday, January 19, 2010 5:03 AM
|
|
|
|
|
Adding that key will not make your program automatically start when Windows starts. It will make your application start when a user logs on to Windows. When the user logs off the system, the program will be terminated if it is still running.
To make your application start when Windows starts, you need to make your application a "Windows Service". If you search for "Windows Service" you will get plenty of information on how to make it.
Good luck and happy programming!
|
|
|
|
|
This doesn't make the application start when Windows starts. This makes it start whenever the user logs in on the machine.
If the name is the same as an existing value, then that value will get overwritten. it will NOT create another copy of the same name/value pair.
|
|
|
|
|
Thank you once again Dave.
I used the wrong terminology. I do actually want the application to start when the user logs on.
You see so many programs today with preference options such as for example "Start Skype when windows starts", that I fell into the trap of using the same sloppy terminology.
With your explanation of how this will behave, I can finish off my app.
Cheers again
Paul
|
|
|
|
|
hi all
am using vb.net 2.0 and crystalreports XIR2 am getttingthis error
can u advice why this type of error is comming
Invalid index. (Exception from HRESULT: 0x8002000B (DISP_E_BADINDEX))
Regards
Vidhish
|
|
|
|
|
|
hi Thomas.
filedname type is FCCurrency Char(3)
Regards
Vidhish
|
|
|
|
|
Can you show us in code where you are getting this error?
I've had this error show up when I use parameters in reports...
|
|
|
|
|
I was asking for the NAME of the field in the report (you know, this things with @....).
|
|
|
|
|
Hi Thomas ,
parameters are
@BranchCode
@CostCode
@AcountCode
@FromDate
@ToDate
Regards
Vidhish
|
|
|
|
|
I'm trying to access a USB port from visual studios 2008 and I want to communicate with a micro controller. We are trying to send three commands to the micro controller, they are Start, Stop and Reset. We have developed the code for the GUI but have no idea how to send this information to the USB port. Also we are trying to determine how to get feed back from the micro controller so we can plot a graph in visual studios 2008. Can anyone help me please?
Thanks,
Josh McGill
|
|
|
|
|
If the microcontroller treats the USB port just like a serial port then all you would do is open the ports and read and write the data in the normal way. Look at My.Computer.Ports
You would need to program the microcontroller to spit out the data to the serial port in a known format, so you could listen for and handle those messages.
What type of microcontroller are you using?
Search google.....there is a shedload of info relating to the net on this subject.
|
|
|
|
|
Hey Dave, thanks for the quick response!
We are using PIC32 Series, digi key part number DM320003-2-ND if your curious. I'm pretty new to the visual studios world and trying to figure it out has proven to be tough. Do you know of any online tutorials that are related to this subject. If you know of any code lessons that teach you how to access the USB ports that would be great. There are so many tools with visual studios and it seems that good tutorials are hard to come by.
Thanks again
josh
|
|
|
|
|
You don't access the USB "ports". Look at what USB stands for: Unviersal Serial BUS. It's not treated like a port, but an expansion bus, like the expansion slots inside the computer. You need to know how the device treats USB. Most devices like this will expose themselves on the bus as a serial port (COM1, COM2, ...). You would just use normal serial port methods to talk to it, not any USB methods.
|
|
|
|
|
Here is an article on CP that is all about communicating with an Arduino micro over serial port using VB.
Principles should be the same for a PIC32.
Arduino with Visual Basic[^]
|
|
|
|
|
my buttons are not dynamics. i got 10 buttons, his name is a number like 100, 101 is for an hotel , but i dont want to make a sub for each button.
sorry if i don't explain me good but i dont speak english
|
|
|
|
|
Hi,
if you connect several Controls to a single handler, you can use the first parameter ("object sender") to identify the source of the event. For buttons, cast the sender to a Button, and you have it. That is exactly why it is there.
|
|
|
|
|
this is what i did
Sub SetHabs(ByVal sender As Object, ByVal e As EventArgs)
Dim boton As New Button
boton = CType(sender, Button)
Dim btnName As String = boton.Name
end sub
with this in each click event i get the name
|
|
|
|
|
Then do a Select Case on the boton.Name and handle what each button should do..
|
|
|
|
|
if the buttons are supposed to do all kinds of different things, then it does not make sense to give them all the same Click handler to begin with...
|
|
|
|
|
thanks, all the buttons represents rooms, in this case all buttons check one fuction , that is the availability for each room so i start to get a name who is a integer to make different things of the same function.
|
|
|
|
|
if you need details about rooms, I trust you either have a Room class that holds that information, or the room number serves as a primary key to a rooms table in a database.
FYI: most WinForms Controls also have a Tag property where you can store one item of information (possibly a reference to a Room instance).
|
|
|
|
|
yes, my I have a room Class and my room number is the primary key in my DB, i have a little trouble becose i only make webs with , php,Ajax,Javascript ETC but this project needed to be a desktop application.
Thank you so much for the help, this is a very cool site and and responses are very fast different from sites in Spanish.
|
|
|
|
|
yes , i think in this case, i have 3 floors in this hotel, so each button name is like f1_100, f1_101 ,only make 3 case with a string search ,then , with this search get the total room name ho is the primary key from my DB.
|
|
|
|