Results 1 to 18 of 18

Thread: Console If not working right

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Dec 2011
    Posts
    346

    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

  2. #2
    Wait... what? weirddemon's Avatar
    Join Date
    Jan 2009
    Location
    USA
    Posts
    3,826

    Re: Console If not working right

    I don't understand. What problem are you having?
    CodeBank contributions: Process Manager, Temp File Cleaner

    Quote Originally Posted by SJWhiteley
    "game trainer" is the same as calling the act of robbing a bank "wealth redistribution"....

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Dec 2011
    Posts
    346

    Re: Console If not working right

    when im using the application if i press enter it automaticly starts one of the arguments.

  4. #4
    Wait... what? weirddemon's Avatar
    Join Date
    Jan 2009
    Location
    USA
    Posts
    3,826

    Re: Console If not working right

    Quote Originally Posted by sherlockturtle View Post
    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

    Quote Originally Posted by SJWhiteley
    "game trainer" is the same as calling the act of robbing a bank "wealth redistribution"....

  5. #5

    Thread Starter
    Hyperactive Member
    Join Date
    Dec 2011
    Posts
    346

    Re: Console If not working right

    Quote Originally Posted by weirddemon View Post
    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?

  6. #6
    Wait... what? weirddemon's Avatar
    Join Date
    Jan 2009
    Location
    USA
    Posts
    3,826

    Re: Console If not working right

    Quote Originally Posted by sherlockturtle View Post
    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

    Quote Originally Posted by SJWhiteley
    "game trainer" is the same as calling the act of robbing a bank "wealth redistribution"....

  7. #7
    Wait... what? weirddemon's Avatar
    Join Date
    Jan 2009
    Location
    USA
    Posts
    3,826

    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

    Quote Originally Posted by SJWhiteley
    "game trainer" is the same as calling the act of robbing a bank "wealth redistribution"....

  8. #8

    Thread Starter
    Hyperactive Member
    Join Date
    Dec 2011
    Posts
    346

    Re: Console If not working right

    Quote Originally Posted by weirddemon View Post
    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.

  9. #9
    Wait... what? weirddemon's Avatar
    Join Date
    Jan 2009
    Location
    USA
    Posts
    3,826

    Re: Console If not working right

    Quote Originally Posted by sherlockturtle View Post
    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

    Quote Originally Posted by SJWhiteley
    "game trainer" is the same as calling the act of robbing a bank "wealth redistribution"....

  10. #10

    Thread Starter
    Hyperactive Member
    Join Date
    Dec 2011
    Posts
    346

    Re: Console If not working right

    I Tried it. I think its just my code all of them do it could you chek

  11. #11
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    40,106

    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

  12. #12
    Wait... what? weirddemon's Avatar
    Join Date
    Jan 2009
    Location
    USA
    Posts
    3,826

    Re: Console If not working right

    Quote Originally Posted by sherlockturtle View Post
    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

    Quote Originally Posted by SJWhiteley
    "game trainer" is the same as calling the act of robbing a bank "wealth redistribution"....

  13. #13

    Thread Starter
    Hyperactive Member
    Join Date
    Dec 2011
    Posts
    346

    Re: Console If not working right

    Quote Originally Posted by weirddemon View Post
    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.

  14. #14
    Wait... what? weirddemon's Avatar
    Join Date
    Jan 2009
    Location
    USA
    Posts
    3,826

    Re: Console If not working right

    Quote Originally Posted by sherlockturtle View Post
    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

    Quote Originally Posted by SJWhiteley
    "game trainer" is the same as calling the act of robbing a bank "wealth redistribution"....

  15. #15

    Thread Starter
    Hyperactive Member
    Join Date
    Dec 2011
    Posts
    346

    Re: Console If not working right

    Quote Originally Posted by weirddemon View Post
    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.

  16. #16
    Frenzied Member
    Join Date
    Nov 2010
    Posts
    1,470

    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 )

  17. #17

    Thread Starter
    Hyperactive Member
    Join Date
    Dec 2011
    Posts
    346

    Re: Console If not working right

    Quote Originally Posted by incidentals View Post
    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.

  18. #18

    Thread Starter
    Hyperactive Member
    Join Date
    Dec 2011
    Posts
    346

    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
  •  



Click Here to Expand Forum to Full Width