Author Topic: Need help with C# - opening programs via buttons.  (Read 2479 times)

I downloaded Microsoft Visual C# 2008 yesterday, and I'm working on a password program to protect your blockland from sisters/brothers. But I have a problem: How do I make it open programs via a button? Heres the code:
Code: [Select]
            string pass = "password";
            pass = textBox1.Text;
            if (pass == "password")
                label1.Text = ("Welcome to Blockland!");
            else
                MessageBox.Show("Incorrect password.");
Please help.
EDIT: new code.
« Last Edit: January 23, 2009, 02:07:07 PM by Svenne »

In visual basic its Formname.show(), So it might be something like that

Code: [Select]
import os

if raw_input("Enter zhe secret password: ") == "blah":
os.system("c:\\blockland\\blockland.exe");
else:
raw_input("Wrong password, press any key to gtfo.")
1) Install Python
2) Save as something.py
3) ???
4) Profit!

Python saves the day!

Code: [Select]
import os

if raw_input("Enter zhe secret password: ") == "blah":
os.system("c:\\blockland\\blockland.exe");
else:
raw_input("Wrong password, press any key to gtfo.")
1) Install Python
2) Save as something.py
3) ???
4) Profit!

Python saves the day!
No.

...
...
I believe it is 'Shell("path");'

No.

...
...
I believe it is 'Shell("path");'
I'm quite sure it isn't.
Now stop acting like a smartass and leave the e-bullying to the pros.

Thank you so much! I'll try this now.

Got problems with "import", here's da code:
Code: [Select]
            {
                import os;
               
                label1.Text = ("Welcome to Blockland!");
                os.system("C:\\Programs/Blockland/Blockland.exe");
            }
What did I do wrong? As I said, I've only got problems with "import".

*BUMP!*
I really need help with this!

The problem is that you're trying to compile python with a c# compiler. Just download python.

The problem is that you're trying to compile python with a c# compiler. Just download python.
I'd rather use Microsoft Visual C#. I've already made gui's for my program. Got anything for Microsoft's?

I'd rather use Microsoft Visual C#. I've already made gui's for my program. Got anything for Microsoft's?
No, .net sucks.

I don't really feel for redoing all my work.
My program uses Windows forms.
And I'm a bit afraid of downloading programs since I downloaded UXTheme Multi-Patcher, and the computer didn't start up.

*BUMP!*
I really need help!