|
How do I save, for say, a number (int x ), for a label to say the number every time it loaded up after the user presses a button (button1 ) that adds one to the number each time. I know it's simplistic, but it would be a good example to learn to save. Also, any data articles could help. I'm going to search for more right now. THink high scores. Thanks.
- "Achieving all knowledge does not mean achieving all wisdom."
- "What's THIS button do... ... ... ?"
|
|
|
|
|
Use session or viewstate for asp.net. For winforms or others use a member variable or a static member depending on the need.
What should I think of high scores btw?
Need a C# Consultant? I'm available.
Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway
|
|
|
|
|
Example? I don't understand. (I'm with winform)
- "Achieving all knowledge does not mean achieving all wisdom."
- "What's THIS button do... ... ... ?"
|
|
|
|
|
You don't understand what a variable means?
Cheers,
Mircea
"Pay people peanuts and you get monkeys" - David Ogilvy
|
|
|
|
|
I hope he knows what a variable is.
"Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus
|
|
|
|
|
Have a look at the Application.config file. In this you can define a field where you can save and later retrieve your value.
"On one of my cards it said I had to find temperatures lower than -8. The numbers I uncovered were -6 and -7 so I thought I had won, and so did the woman in the shop. But when she scanned the card the machine said I hadn't.
"I phoned Camelot and they fobbed me off with some story that -6 is higher - not lower - than -8 but I'm not having it."
Tina Farrell, a 23 year old thicky from Levenshulme, Manchester.
|
|
|
|
|
I've watched you, on this forum, develop this game from moving a simple shape across the screen to now storing the highscores. You *MUST* create an article on CP and post the results. I guarantee, from comments made about you in this forum (all favourable - honest!), I am not the only one interseted in what you have achieved.
|
|
|
|
|
Honestly, nothing's really got that far yet; I made this SUPER SUPER SUPER simple game one weekend, but it sucks. I'm working on one now, so maybe I'll have something in a while. I've got lots of school work. Oh, and positive comments about me? Nah.
- "Achieving all knowledge does not mean achieving all wisdom."
- "What's THIS button do... ... ... ?"
|
|
|
|
|
Also, the one I'm working on right now is a puzzle game. Simple, but hopefully I'll finish and it'll be cool. It has some interesting effects. Honestly though, thanks for caring about my code!
- "Achieving all knowledge does not mean achieving all wisdom."
- "What's THIS button do... ... ... ?"
|
|
|
|
|
I'd store high scores using a text file or XML. A text file is easy File.ReadAllLines will read it in, and each line could be a name, a comma and a score. Just whatever you use for a delimiter, make sure people cannot enter it.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
I agree, that way I can easily edit the text file and always have the highest score without ever playing.
|
|
|
|
|
Please provide me code for General peer to peer application as in GNUTELLA..
I have the all guidelines to write the program but dont know socket programming....
can anyone reply please so that we can share things and let me understand the code as soon as possible......
Thank you in advance
sagar
|
|
|
|
|
ur_sagar_54 wrote: I need a code in C
Do you really need code in C, or do you mean C++ or C#?
Please read the forum guidelines[^], especially points 1, 2 and 3.
Experience is the sum of all the mistakes you have done.
|
|
|
|
|
Also asking for code won't get your very far. If you don't know socket programming, then go and look at a tutorial. If you don't understand something, or if something doesn't work, then you can ask for help in the appropriate forum.
My current favourite word is: Waffle
Cheese is still good though.
|
|
|
|
|
If you need it in C, you are in the wrong place. This is for C#
"Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus
|
|
|
|
|
thank you for ur concern........
Please help me because i have to submit my project.....
if you are interested i ll give you the details of the project..
please reply me as soon as posible....
I cant post it in C#..
I am sorry
sagar
|
|
|
|
|
Hello Form
I know there are many ways to send parameters form a parent to a child via constructer etc. but how can I get the value back.
I have a grid with the data (not bound to a data base), and by clicking on a button a new from opens where the user can modify the data, how can I get the data back so I can display the modified data on the grid?
Thanks
|
|
|
|
|
Create an event on a child form and register the listener on the parent. Also, if you pass an object to the child form the data will be retained by the two. Thus, instead of creating an event, you would only need to listen to the child form's closed event.
Need a C# Consultant? I'm available.
Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway
|
|
|
|
|
thanks,
i am new at this, do you have any small example how to pass an object, update it in the child form, and get the updated values in the parent form
Thanks Again
|
|
|
|
|
I retrevied the Images from Database And Display In datalist.
I used Two Buttons(prev and Next).
Here I place one image control at the top.
At Bottom In datalist All the Images is displaying.
At first in that image control first image will be displaying.
if we click next button then next image will be displayed.
if we click previous button then previous image will be displayed.
Here this buttons is not working.please Send the code In Detail Immediatly.
Its Urgent.
Thanking You,
CWAHHHHHH
|
|
|
|
|
I found this in some code I'm working on:
class MyClass
{
private MyObject obj;
public MyClass()
{
obj = new global::MyObject();
}
}
What does the "global:: " do?
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
John Simmons / outlaw programmer wrote: What does the "global::" do?
Namespaces and class names and such can be resolved relatively from what is in the using statements. Prefixing a type name with global:: forces the compiler to start from the top of the namespace tree.
using System;
...
Console.WriteLine();
using System;
using MyConsoleStuff;
Console.WriteLine();
System.Console.WriteLine();
global::System.Console.WriteLine();
|
|
|
|
|
Colin Angus Mackay wrote: global::
Is this new to .NET 2.0 ?
|
|
|
|
|
N a v a n e e t h wrote: Is this new to .NET 2.0 ?
I think it is although I'm not 100% sure.
|
|
|
|
|
I want to encapsolate my code no one can see the code even he get my source code(project soulution)
merwa
|
|
|
|