Two questions in one. First question is most important.

09/16/2011 07:36 xBlackPlagu3x#1
1.) Okay so I built a GUI for my server using Fang's guide and then I made it so I could use commands and whatnot and it says I've got no errors except 3. And the errors have something to do with the Program.WriteLine. In my GUI I have it set so that it Writes 1 argument, but some of the arguments in other portions of the source have up to 4 arguments!!!

Is there a way that I can set my WriteLine (to the gui) to take UP TO 4 arguments?


2.) This question is slightly sinister, I can understand if you don't want to answer it. Is it possible to code a program to ping a specific IP with a specific Port with whatever Data I want while encrypting my IP? That'd be pretty legit if I could, if anything just to screw with my friends. Yeah, I would probably test it out on an ignorant server owner or two, but I mainly want it to mess with my friends who have busy ports!
09/16/2011 07:45 BaussHacker#2
1. make 4 parameters of the method.
2. encrypt your ip? lolwut
09/16/2011 07:51 xBlackPlagu3x#3
Quote:
Originally Posted by BaussHacker View Post
1. make 4 parameters of the method.
2. encrypt your ip? lolwut
1. When I put 4 parameters of the method, it expects 4 arguments. It fixes the errors that say "[expecting] 4 arguments" but then adds on the ones that say "[expecting] 1 argument"

2. Idk, I just thought it might be possible I mean you can encrypt a lot of stuff and I'm sure that if you sent data to a computer the computer could tell who sent it and I thought it would be possible to encrypt who you are so they computer can't tell. (Who you are being your IP)

I now no longer have the arguments problem. Now I have the problem of my commands not working. I do something like this

(insert my button void here)
{
if (inputCommand.text.Contains("/exit"))
{
Environment.Exit(0);
}
}

That's really what my void looks like right now and it's not working. What's up with that?
09/16/2011 09:52 BaussHacker#4
Quote:
Originally Posted by xBlackPlagu3x View Post
1. When I put 4 parameters of the method, it expects 4 arguments. It fixes the errors that say "[expecting] 4 arguments" but then adds on the ones that say "[expecting] 1 argument"

2. Idk, I just thought it might be possible I mean you can encrypt a lot of stuff and I'm sure that if you sent data to a computer the computer could tell who sent it and I thought it would be possible to encrypt who you are so they computer can't tell. (Who you are being your IP)

I now no longer have the arguments problem. Now I have the problem of my commands not working. I do something like this

(insert my button void here)
{
if (inputCommand.text.Contains("/exit"))
{
Environment.Exit(0);
}
}

That's really what my void looks like right now and it's not working. What's up with that?
You can't encrypt your IP. You can use a proxy or a vpn tho, but your IP will never be 'hidden'.

About that they aren't working anymore, probably because you need to set the event on the button again, it happens if you either move or edit it sometimes.
09/16/2011 15:19 xBlackPlagu3x#5
I solved it I supposed, instead of having commands I just used a menu strip. It's how I prefer things though so it's okay, I like having a menu strip, makes it look kinda stylish. Now that I have a GUI going on and I can officially start development, I'm off to the races! Wish me luck that I can join the ranks of those who don't fail...
09/16/2011 20:22 pro4never#6
Try using default values or various versions of the same method if you want to only use 1 param sometimes.


Super basic example...

public static void WriteLine(string infoOne, string infoTwo = "", string infoThree = "")
{
Console.WriteLine(infoOne + " " + infoTwo + " " + infoThree);
}

If nothing is added for infoTwo or Three it won't matter (incredibly useless example but you get the idea)
09/16/2011 20:26 xBlackPlagu3x#7
Quote:
Originally Posted by pro4never View Post
Try using default values or various versions of the same method if you want to only use 1 param sometimes.


Super basic example...

public static void WriteLine(string infoOne, string infoTwo = "", string infoThree = "")
{
Console.WriteLine(infoOne + " " + infoTwo + " " + infoThree);
}

If nothing is added for infoTwo or Three it won't matter (incredibly useless example but you get the idea)
That's actually a brilliant idea.

I just solved it by using this:
Code:
Console.WriteLine("ErrorID: " + Error.ID);
Instead of:
Code:
Console.WriteLine("ErrorID: {0}", Error.ID);
09/17/2011 05:36 .Kinshi#8
Quote:
Originally Posted by pro4never View Post
Try using default values or various versions of the same method if you want to only use 1 param sometimes.


Super basic example...

public static void WriteLine(string infoOne, string infoTwo = "", string infoThree = "")
{
Console.WriteLine(infoOne + " " + infoTwo + " " + infoThree);
}

If nothing is added for infoTwo or Three it won't matter (incredibly useless example but you get the idea)
Use params instead, like Console.WriteLine does.

Code:
public static void Write(String s, params Object[] p)
{
    if (p != null)
        for (int i = 0; i < p.Length; i++)
            s = s.Replace("{" + i + "}", p[i].ToString());
}