MichealC4
Programmer
- Jun 26, 2003
- 457
Hello people. I hope someone can answer my questions.
I'm writing a simple program that right now pulls from a text file and displays it in a textbox. The user then clicks a button after a few seconds saying they agree to the above text. That works great, no problem there. But because I've only been using C# for my second day now, I'm a bit of a greenie to it. I do however have experience in other languages.
So, here's what I am looking to do.
Parameters for the following:
- Choose file name
- Choose timelimit for the button to display
- Choose whether a name field will be on or off
Details:
File name will be in the same directory as the excutable which will be called in a login script from Active Directory. Should be no problem there.
The timelimit shouldn't be a problem either. I just want to call the program (which is GUI, by the way), set a timelimit based on who is viewing the agreement, and off we go.
The name field carries a bit with it. The purpose is knowing who accepted the agreement when. Of course, this will have to write to a file on the network the time, the name, and the computer id.
The problem I am having is getting the switch to handle the parameters. So far, it looks like C# does parameters a bit differently. Maybe I'm just imagining things. Here's what it'd look like:
myexe.exe -file=abc.txt -time=6 -name=on
myexe.exe -file=xyz.txt -time=3 -name=off
myexe.exe -file=tuv.txt -time=0 -name=on
So, even if the time is disabled, the name may still have to be entered. Also, I need it to validate the name in realtime. I don't want them to get around it by using spaces or some such, they need to format their name like John, Doe or John,Doe or something to that effect. There are a few other things that need to be done with the program such as popping up another window for the user to logoff after they are done. But that'll come later. Thanks!
----------------------------
"Will work for bandwidth" - Thinkgeek T-shirt
I'm writing a simple program that right now pulls from a text file and displays it in a textbox. The user then clicks a button after a few seconds saying they agree to the above text. That works great, no problem there. But because I've only been using C# for my second day now, I'm a bit of a greenie to it. I do however have experience in other languages.
So, here's what I am looking to do.
Parameters for the following:
- Choose file name
- Choose timelimit for the button to display
- Choose whether a name field will be on or off
Details:
File name will be in the same directory as the excutable which will be called in a login script from Active Directory. Should be no problem there.
The timelimit shouldn't be a problem either. I just want to call the program (which is GUI, by the way), set a timelimit based on who is viewing the agreement, and off we go.
The name field carries a bit with it. The purpose is knowing who accepted the agreement when. Of course, this will have to write to a file on the network the time, the name, and the computer id.
The problem I am having is getting the switch to handle the parameters. So far, it looks like C# does parameters a bit differently. Maybe I'm just imagining things. Here's what it'd look like:
myexe.exe -file=abc.txt -time=6 -name=on
myexe.exe -file=xyz.txt -time=3 -name=off
myexe.exe -file=tuv.txt -time=0 -name=on
So, even if the time is disabled, the name may still have to be entered. Also, I need it to validate the name in realtime. I don't want them to get around it by using spaces or some such, they need to format their name like John, Doe or John,Doe or something to that effect. There are a few other things that need to be done with the program such as popping up another window for the user to logoff after they are done. But that'll come later. Thanks!
----------------------------
"Will work for bandwidth" - Thinkgeek T-shirt