ID Checker That Checks Registry Value. If It Does Not Equal To The String, Then The Program Will Close?
Oct 30, 2009
I'm just messing around coding a ID Checker that checks registry value. if it does not equal to the string, then the program will close as so:
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim check As String
check = "XXXXXXXXXXXXXXXXXX"[code]....
Now what im trying to do is, where the 'check' is, i want to add more than one UniqueID so that other users can use the app. Lets say a user with a UniqueID of YYYYYYYYYYYYY purchased my app and recieves updates.
View 3 Replies
ADVERTISEMENT
Feb 14, 2011
I have a class that needs to check for errors in the data contained in a object.The routines that will check for errors could be implemented in concrete interfaces of supertype IErrorCheck. That way error checks can be discrete and added or removed from the class that requests the error checks.Each IErrorCheck implementation would be programmed against the supertype IErrorCheck (Strategy).But it would be nice not to recompile when checks are added or removed.Is there an accepted procedure for abstracting the error checks all the way out of the program, such as to read the checks from a file?
View 2 Replies
Feb 13, 2009
I want to create a program that checks the characters of the string "George123" . If a number is found in the string then a message box will pop up. Here is where the problem lies. I created a for loop that inspects each character of the string George123 and when it reaches the number 123 the message box pops up. The only problem with the message box is that it appears 3 times as there are three numbers in the string. So my question is how do i exit a for loop right after the first number is found in the string.
Code:
Dim onecharacter As Char
Dim Enter As String
[code].....
View 2 Replies
Feb 25, 2010
If e.CommandLine.Count > 0 Then
Dim IncomingCommand As String = e.CommandLine.Item(0).ToString
If IncomingCommand.Substring(0, 2) = "-1" Then
form1.close()
End If
End If
I am trying to make the program close if the -1 string is sent with the program. See my installer allows for me to run certain programs before it actually installs, but it doesn't shut down copies of the program itself. So I have a next startup instance set to shut the program down if the -1 is received. But if the program is not running it starts up instead. This is not desired. form1.close doesn't work. e.cancel = true doesn't work, etc etc. What can I do to make the program not start during this instance.
View 1 Replies
Sep 20, 2010
i have to write a program for my VB class that consists of a resistance checker program. I've searched like a madman to help me through this and I have found nothing >. The program consists of 2 combo boxes, the first one is the nominal resistance drop down list of the numbers :100, 150, 220, 330, 470, 680, 820 and 1000. The second list is of the tolerance numbers; +/- 0.4%, +/-0.6% and +/-0.8%. Now what i want to do is select a number from the first combo box and select the tolerance level of the second combo box and i input the resistor of said value into the text box. when i click the check resistor button it should display a message saying if the resistor is in or out of tolerance. For now I have the form all laid out and the values inputted into both combo boxes and i can go to run the program i am able to select said values. Now my problem is trying to get the right code so that i can check the resistors value.
View 2 Replies
May 24, 2010
I would like to take blank secure stock paper and convert it in to a check.
I know you can get magnetic toner and print MICR.
The question is What is the actual font to use or should i get a package and send the data to it to print the check?
Has anybody done it successfully without having to resort to pre-printed checks.
View 2 Replies
Apr 24, 2011
I need to create a a palindrome checker program. Now I know how to check a simple palindrome by using the reverse method however I am unsure if the palindrome had special characters or spaces. My question is what is the code for removing spaces and special characters from a string using loops and if statements. Also we cannot use arrays.
View 9 Replies
Jan 27, 2010
I should I do so that when a program is run, it automatically checks for conditions. If true, it will continue opening the form but if false, it opens another. What I've done is it goes directly to one form and if false it will close the form using me.hide() and loads a form using Form1.show(). Problem is, if the condition is false, both forms will open. What is the right way to do this?
View 17 Replies
Apr 12, 2012
I have a simple question about string concatenation. Following is the code. I want to ask why s6 = "abcde" and not "akcde"? I have change the s2 value to "k".
Public Class Form1
Public s1 As String = "a"
Public s2 As String = "b"
[Code]....
View 5 Replies
Nov 22, 2010
Can not resolve this. Two radio buttons data binded inside a group box.
Click one thats not checked. Both un check. Must click again
Possible related situation here [URL]
writitng the my.settings manually.
View 2 Replies
Oct 26, 2009
I understand the concept of regular expressions but I am looking for a regular expression string that checks the input string for the following criteria only...
1.) Upper and lower case letters
2.) The space character
3.) Apostrophe
4.) Comma
5.) Period
6.) Hyphen
View 9 Replies
Jan 10, 2012
im trying to write a program that checks a website if a certain value is within a limit and if not enters a value into a text box and submits the information. I have researched into httpwebrequest however i cannot quite figure out how to progress from page to page. I also found that i can do browser manipulation however I don't a browser to be a open while the program is waiting for a specific value. So is there any way to do something like browser manipulation without the browser?
View 2 Replies
Apr 13, 2010
Why does the first if statement evaluate to true? I know if I use "is" instead of "=" then it won't evaluate to true. If I replace String.Empty with "Foo" it doesn't evaluate to true. Both String.Empty and "Foo" have the same type of String, so why does one evaluate to true and the other doesn't?
//this evaluates to true
If Nothing = String.Empty Then
[CODE]...
View 3 Replies
Oct 6, 2009
I am trying to write an IF statement that checks to see if a certain String variable is not equal to a certain value. What is the best way to do this?
Method #1
IF NOT(Nametxt.Equals("Fred")) Then
x = 3
[code].....
View 10 Replies
Sep 17, 2011
I've been having a glitch in my program for the last couple of hours in development. After some investigation, shows that one of my string variables apparently not what it says it is. Lets take a look:
[Code]...
View 2 Replies
Jul 24, 2010
I should mention that I'm mainly concerned with Random files.Which is the best method?
1.) Open file, manipulate data and immediatly close the file. (Which means doing this alot everytime data needs to be read, edited, deleted, or saved)
(2.) Open the file when the app starts and let it open for data manipulation until it's time to close the app at which time the file would be closed.
I was always taught option 1. The main reason at the time was to cut down on the chance for data corruption in the file or an outright loss of the file due to outside circumstances like power failure.
View 1 Replies
Feb 1, 2008
I have a string which can be of any length. I want to loop tthrough this string and if there 53 characters assign that to Variable1, then loop round again and assign the next 53 characters or less to variable2 etc etc until the end of the string. Ideally I would not want to split words - but that is another problem.....
View 10 Replies
Oct 14, 2011
i have a listbox that contains the words "week1", "week2",all the way up to "week52" and when i select a week from the listbox it will retrieve a value from a mysql database that will represent a progress bar value. my progress bar has a range of 0-120 and i would like to have all the weeks that have values higher than 100 to be highlighted or marked somehow, in the listbox. so my question is, "is there a way to set the background color of certain weeks in the listbox to orange based on the value that they represent on the database?
for example for "week1", the value is 114, so when the listbox loads, i want the background color of the item "week1" in the list to be orange (indicating that it's current value is higher than 100)? i know that this requires me to implement a user defined drawing function for the listbox items but i dont know where i would even start. i would like this to be somewhat automatic so that it checks the values and changes the background colors of any value higher than 100, instead of me specifying a name of the item.
View 1 Replies
May 19, 2012
In the following LINQ query, i would like when the Loc=Locale.Gr all the records with GrID=100 returned and when the Loc is anything else all the other records with GrID <> 100 returned.How can i achieve this one? I tried something like the following, but it is totally wrong.
PrivateSub Test(Byval Loc as Locale)
Private Const GrID as integer = 100
Dim Query = From c In Mob Where c.CountryID = IIf(Loc = Locale.Gr, GrID, <> GrID) select c
End Sub
[Code]...
View 1 Replies
Jun 28, 2010
This must've have been asked before but I couldn't locate it. In a mixed code project (VB and C#) we were debugging some old Visual Basic code where a statement as follows could be found:
If Request.Params("xxx") <> "" Then
'do something
I considered this a bug as Request.Params could be null, in which case the statement would've become false which wasn't the idea. So I thought. I just found out, -- probably for the tenth time and I will keep forgetting -- that the following two statements are not equal, while Nothing in VB should be equal to null in C# (thought I):
if(String.Empty == null) // always false
If String.Empty = Nothing Then ' always true
Should I dismiss this as a typical Microsoft backward compatibility effort, or should I consider this a huge error in the VB.NET compiler? Does anybody know the Microsoftean opinion on this oddity?
View 3 Replies
Mar 14, 2009
I have a form that I am adding a set of buttons to. I am adding an event to those buttons. I need this event to function slightly to determine what button was pressed.
I need the button to simply set a string variable equal to the clicked buttons text so I can determine what button was pressed.
How can this be accomplished?
''Adding the buttons''
For Each dr In dtMenus
Dim strMenuName As String
strMenuName = dr.Item("strMenuName").ToString
[CODE]...
View 5 Replies
Feb 11, 2012
What I want to do is to add a new student loan and the program checks the book title if loan exists, does not allow the same loan to be created. There is no limit on the number of loan placed by the student. How do I write the code as above in VB.NET Note: 1 book Per Loan number Add Loan Form
View 1 Replies
Oct 13, 2009
i am trying to write a little program that checks for a process and kills is.here is the
Dim p As Process = Process.GetProcessesByName("Cheat Engine")(0)
p.CloseMainWindow()[code]...
My problem is it�s woking ,yes if the programm ,,Cheat Engine" is running the process is getting killed.But if the program is not running my program crashes.
View 5 Replies
Mar 8, 2012
How does one check to see if the system time is equal or not equal to a specific time? So, say I want to perform an action if your system time is between 6pm and 6am. Or something similar?
View 1 Replies
Sep 2, 2011
I am making a program that NEEDS to be password protected, so i made a textbox with a code so that when the user enters the right password it lets you in. But if the user/person enters a wrong password 2X it will kick you out. So is there a way to keep the
View 3 Replies
Jan 16, 2009
I'm currently in the process of building a text editor type program, and have run into a brick wall. I haven't done VB in years, so I may just need a little reminder on some things. I have coded everything so far as far as opening files, saving them, changing fonts, colors, etc. However, I'm looking to add a Close button to my menu strip that will just close the currently opened file, and not the entire program, while also ask the user if he/she would like to save before closing the file, and then if they select yes, it will show the save dialog, and if not, it will go ahead and close the currently opened item.
View 2 Replies
Apr 17, 2009
I am trying to build a small program which will allow some one to click on the exit button and the sound will play and at the end of the sound the program will then close. The sound clip is about 3 seconds long Here is what I have:
Imports Microsoft.DirectX
Imports Microsoft.DirectX.DirectSound
Public Class Form1
Private Dsound As CSoundDevice
[code]....
View 14 Replies
Jun 30, 2009
I need to delete a registry string value.The registry string value that I'm trying to delete is:
HKEY_LOCAL_MACHINESoftwareMicrosoftMSDN SetupDefaultSet
I've tried googling for results, but none of the sample scrips I have located have done the trick.They all seem to throw a bunch of errors in Visual Basic 2008 Express Edition.
View 9 Replies
Jan 8, 2011
I want to read a string from a registry key, if its 0 do one thing, and if its 1, do something else.
This code (if it works..) would at the first time create a sub key, and assign it to 1, but if its not existing, it would then show a few messageboxe's - But it doesnt work, even if I set it to 1 or 0, it won't work, it always displays the messages.
If My.Computer.Registry.GetValue("HKEY_CURRENT_USERA Sim Game StudiosA Sim Game - Business",
"FirstRun", "1") Then
MessageBox.Show("Your name is Jay J, you are 23 years old")
[Code].....
View 2 Replies
Feb 3, 2012
I am trying to do a query on the registry for uninstallation of a program but dont know where to start.The structure would be like so:If {123-456-789} exisits in registry then run Msi.exe /x {123-456-789}therwise run
View 2 Replies