|
-
Dec 31st, 2011, 09:30 PM
#1
Thread Starter
Hyperactive Member
Console If not working right
So i decided to make a fake hacker to try to learn how to use a command line. But when i get it up even when i press enter it automatically works.
To test on a console in security disabled clickonce
Code:
Module Module1
Sub Main()
Dim i As Integer
Dim l As Integer
Dim chance As Integer = Rnd(1)
For Each arg In My.Application.CommandLineArgs
If arg = "/Load_Hacker" Then
Console.WriteLine("Loaded")
Console.ReadLine()
i = 1
ElseIf arg = "/Get_Level_IP" Then
Console.WriteLine("Searching")
Console.WriteLine("Complete")
Console.WriteLine("IP_163.784.222.01")
Console.ReadLine()
l = 1
ElseIf arg = "/Send_Spike_To_163.784.222.01" And l > 0 Then
chance = (Str(Int(Rnd() * 4)))
Console.WriteLine("Sending_Spike")
Console.WriteLine("Spike_Sent")
Console.WriteLine("Receving_Data")
Console.WriteLine("No_Fire_Wall")
Console.WriteLine("Password_luchis")
Console.WriteLine("Connection_Clear")
Console.ReadLine()
l = 2
ElseIf arg = "/Access_163.784.222.01_With_luchis" And l > 1 Then
Console.WriteLine("Sending")
Console.WriteLine("Verifying")
Console.WriteLine("Accesing")
Console.WriteLine("Complete")
Console.WriteLine("Accesed_3_Folders")
Console.WriteLine("Pictures")
Console.WriteLine("Documents")
Console.WriteLine("Applications")
l = 3
Console.ReadLine()
ElseIf arg = "/Access_Pictures" And l > 2 Then
Console.WriteLine("Empty_Folder")
Console.ReadLine()
ElseIf arg = "/Access_Applications" And l > 2 Then
Console.WriteLine("Word")
Console.WriteLine("IE")
Console.ReadLine()
ElseIf arg = "/Access_Document" And l > 2 Then
Console.WriteLine("Favorite")
Console.ReadLine()
ElseIf arg = "/Access_Document_Favorite" And l > 2 Then
Console.WriteLine("My favorite food is salmon.")
Console.ReadLine()
Else
Console.WriteLine("EROR")
Console.ReadLine()
End If
Next
End Sub
End Module
-
Dec 31st, 2011, 10:29 PM
#2
Re: Console If not working right
I don't understand. What problem are you having?
CodeBank contributions: Process Manager, Temp File Cleaner
 Originally Posted by SJWhiteley
"game trainer" is the same as calling the act of robbing a bank "wealth redistribution"....
-
Dec 31st, 2011, 10:55 PM
#3
Thread Starter
Hyperactive Member
Re: Console If not working right
when im using the application if i press enter it automaticly starts one of the arguments.
-
Dec 31st, 2011, 11:04 PM
#4
Re: Console If not working right
 Originally Posted by sherlockturtle
when im using the application if i press enter it automaticly starts one of the arguments.
Oh. Which one? Did you set a break point and walk through the code?
CodeBank contributions: Process Manager, Temp File Cleaner
 Originally Posted by SJWhiteley
"game trainer" is the same as calling the act of robbing a bank "wealth redistribution"....
-
Dec 31st, 2011, 11:06 PM
#5
Thread Starter
Hyperactive Member
Re: Console If not working right
 Originally Posted by weirddemon
Oh. Which one? Did you set a break point and walk through the code?
They all will if i keep pressing enter.. Whats a break point?
-
Dec 31st, 2011, 11:10 PM
#6
Re: Console If not working right
 Originally Posted by sherlockturtle
They all will if i keep pressing enter.. Whats a break point?
Break points are very important and allow you to step through the code, among other things. So you can see what is happening as it happens.
Look at this.
CodeBank contributions: Process Manager, Temp File Cleaner
 Originally Posted by SJWhiteley
"game trainer" is the same as calling the act of robbing a bank "wealth redistribution"....
-
Dec 31st, 2011, 11:13 PM
#7
Re: Console If not working right
Also, I just ran your code without a command line argument and it behaves as normal. The app opens and then closes.
CodeBank contributions: Process Manager, Temp File Cleaner
 Originally Posted by SJWhiteley
"game trainer" is the same as calling the act of robbing a bank "wealth redistribution"....
-
Dec 31st, 2011, 11:14 PM
#8
Thread Starter
Hyperactive Member
Re: Console If not working right
 Originally Posted by weirddemon
Break points are very important and allow you to step through the code, among other things. So you can see what is happening as it happens.
Look at this.
Sorry im not able to use them i use 2010 express edition.
-
Dec 31st, 2011, 11:16 PM
#9
Re: Console If not working right
 Originally Posted by sherlockturtle
Sorry im not able to use them i use 2010 express edition.
What are you talking about? Break points can be used in every version of Visual Studio. I posted a link to a search results page for visual studio and break points. Look through the links, read up and you'll find out how to use break points.
CodeBank contributions: Process Manager, Temp File Cleaner
 Originally Posted by SJWhiteley
"game trainer" is the same as calling the act of robbing a bank "wealth redistribution"....
-
Dec 31st, 2011, 11:22 PM
#10
Thread Starter
Hyperactive Member
Re: Console If not working right
I Tried it. I think its just my code all of them do it could you chek
-
Dec 31st, 2011, 11:22 PM
#11
Re: Console If not working right
And you SHOULD learn how to use breakpoints, as it is the single most valuable tool for figuring out problems.
My usual boring signature: Nothing
 
-
Dec 31st, 2011, 11:26 PM
#12
Re: Console If not working right
 Originally Posted by sherlockturtle
I Tried it. I think its just my code all of them do it could you chek
You need to learn break points. Of course the problem is your code. Break points help us figure out which part of the code is the issue.
As Shaggy mentioned, it is the most valuable tool we have to solve problems. I can't even count the number of crazy problems I've solved by just using break points.
If you want to learn how to program, then do so. But don't be lazy. Especially with fundamental things like this.
Also, I did try out the code. I had no problems. It worked as expected. Which means something is different on your end. Which means you need to set a break up, walk through the code and find the problem.
CodeBank contributions: Process Manager, Temp File Cleaner
 Originally Posted by SJWhiteley
"game trainer" is the same as calling the act of robbing a bank "wealth redistribution"....
-
Dec 31st, 2011, 11:32 PM
#13
Thread Starter
Hyperactive Member
Re: Console If not working right
 Originally Posted by weirddemon
You need to learn break points. Of course the problem is your code. Break points help us figure out which part of the code is the issue.
As Shaggy mentioned, it is the most valuable tool we have to solve problems. I can't even count the number of crazy problems I've solved by just using break points.
If you want to learn how to program, then do so. But don't be lazy. Especially with fundamental things like this.
Also, I did try out the code. I had no problems. It worked as expected. Which means something is different on your end. Which means you need to set a break up, walk through the code and find the problem.
ok but first do you debug it an disable click once? That how i am doing it. the breaks i used and they start on the second argument.
-
Dec 31st, 2011, 11:33 PM
#14
Re: Console If not working right
 Originally Posted by sherlockturtle
ok but first do you debug it an disable click once? That how i am doing it. the breaks i used and they start on the second argument.
I don't use ClickOnce and I'm done helping. I refuse to help people who don't want to help themselves. I'm sure someone else will come along.
CodeBank contributions: Process Manager, Temp File Cleaner
 Originally Posted by SJWhiteley
"game trainer" is the same as calling the act of robbing a bank "wealth redistribution"....
-
Dec 31st, 2011, 11:37 PM
#15
Thread Starter
Hyperactive Member
Re: Console If not working right
 Originally Posted by weirddemon
You need to learn break points. Of course the problem is your code. Break points help us figure out which part of the code is the issue.
As Shaggy mentioned, it is the most valuable tool we have to solve problems. I can't even count the number of crazy problems I've solved by just using break points.
If you want to learn how to program, then do so. But don't be lazy. Especially with fundamental things like this.
Also, I did try out the code. I had no problems. It worked as expected. Which means something is different on your end. Which means you need to set a break up, walk through the code and find the problem.
ok but first did you debug it an disable click once? That how i am doing it. the breaks i used and they start on the second argument.
-
Jan 1st, 2012, 06:50 AM
#16
Frenzied Member
Re: Console If not working right
put a stop
infact lots of them
throughout your code
and when run you can look at values in the code and the immediate window
the use of if else if is to polite CARP
too many else ifs
use the select instead
and put the halt/escape/kill process acion at the top to get out of it quicker
here to help ( but you must try )
-
Jan 1st, 2012, 11:11 AM
#17
Thread Starter
Hyperactive Member
Re: Console If not working right
 Originally Posted by incidentals
put a stop
infact lots of them
throughout your code
and when run you can look at values in the code and the immediate window
the use of if else if is to polite CARP
too many else ifs
use the select instead
and put the halt/escape/kill process acion at the top to get out of it quicker
here to help ( but you must try )
Ok ive researched them and used them. But ive looked it up and i cant seem to find if there's a way to check two values with them?
Edit: I used ifs inside of them instead of saying and, because that did not work. But when i press debug and press enter it works but it should only work if i type in the argument.
Last edited by sherlockturtle; Jan 1st, 2012 at 06:12 PM.
-
Jan 1st, 2012, 04:44 PM
#18
Thread Starter
Hyperactive Member
Re: Console If not working right
Ok i know im not good at figuring things out but could one of you guys send me my code that there that youve published because when i published and try it if i press enter after anything it shuts down the program.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|