I have a few questions I would like to ask.
1. If I was going to make a program that uses serial codes, how do i make it read a list of them. And if the serial entered is not equal to the codes. It closes using Application.exit(); command?
2. When I use the my program to open text files, how do I show the text from the file in the text box?
3. When I use a diff form to save files. How do I get the text from the Form1 in the label box to the save form where I save it? I have tried everything. But I still cannot fiqure that out, its really just giving me a head ache.
Yes, I know theses are dumb questions. But what do you expect for a programming noob?
1. Don't. It's easily circumventable and not worth it.
2. [url]http://msdn.microsoft.com/en-us/library/db5x7c0d.aspx[/url]
3. Use this instead: [url]http://msdn.microsoft.com/en-us/library/system.windows.forms.savefiledialog.aspx[/url]
2 tells me how to read it. I want it to open the file and put the text into the text box in side the program. Like when you open a text file using a textdoc.
[QUOTE=mikehadley;18056884]2 tells me how to read it. I want it to open the file and put the text into the text box in side the program. Like when you open a text file using a textdoc.[/QUOTE]
That's reading a file..
Something along the lines of:
[code]using (StreamReader sr = new StreamReader("TestFile.txt"))
{
textbox.Text = sr.ReadToEnd();
}[/code]
As for 1, don't even think about it. Serial codes are not just stored with the game, they use complex algorithms to determine if you entered the right code. Learn C# and .Net properly first.
Well im using a richTextBox now with this:
[code]
openFile1.Filter = "txt files (*.txt)|*.txt|All files (*.*)|*.* | Lua Files (*.lua |*.lua";
if (openFile1.ShowDialog() == System.Windows.Forms.DialogResult.OK)
richTextBox1.LoadFile(openFile1.FileName,
RichTextBoxStreamType.PlainText);
[/code]
After searching serveral hours on google.
Snip <>
There is a easier way. But it needs alot of codeing for it to work.
As far as I know (and I could be wrong), don't programs have an algorithm that simply matches a serial key (generated using the algorithm, and see if that key matches the algorithm?
Then how is it easier?
Uses less things to use. You make a internal list and tell it to read from it. if the code entered doesn't match any. It gives back an error. Its advanced as in has alot of coding. The activation thing needs a server, with a connection from the program to the server. Which is intensely advanced.
Useing the codes programmed into the program iteslf makes it easier. Uses less skill, but uses one hell of alot of typeing.
Serials are advanced no matter what you do. You can just use one serial. But if you do that your going to have a problem because everyone will use the exact same code.
[QUOTE=Funcoot;18069221]As far as I know (and I could be wrong), don't programs have an algorithm that simply matches a serial key (generated using the algorithm, and see if that key matches the algorithm?[/QUOTE]
They use that, or public key cryptography.
What is public key cryptography?
[QUOTE=Funcoot;18073716]What is public key cryptography?[/QUOTE]
[url]http://en.wikipedia.org/wiki/Public_key_cryptography[/url]
one key to encrypt, another to decrypt.
[QUOTE=computerwizard;18069350]Uses less things to use. You make a internal list and tell it to read from it. if the code entered doesn't match any. It gives back an error. Its advanced as in has alot of coding. The activation thing needs a server, with a connection from the program to the server. Which is intensely advanced.
Useing the codes programmed into the program iteslf makes it easier. Uses less skill, but uses one hell of alot of typeing.
Serials are advanced no matter what you do. You can just use one serial. But if you do that your going to have a problem because everyone will use the exact same code.[/QUOTE]
That really doesn't make any sense.
You can use File.ReadAllText() if you want to quickly load a text file into a string variable:
var result = File.ReadAllText("myfile.txt");
[QUOTE=streeter;18164329]That really doesn't make any sense.
You can use File.ReadAllText() if you want to quickly load a text file into a string variable:
var result = File.ReadAllText("myfile.txt");[/QUOTE]
What? How is that relevant to that post?
Sorry, you need to Log In to post a reply to this thread.