|
Oh!
That makes total sense now.
I didn't see that coming, nor did the extra } give me a clue as well.
I can see now when I updated the screen rectangle in the model, the file got longer.
Thank you very much!
Appreciated!
If it ain't broke don't fix it
Discover my world at jkirkerx.com
|
|
|
|
|
Oh, and you posted VB.NET code in a C# forum. Watch what you click on next time.
|
|
|
|
|
I had just closed a typescript project and reopened this vb project and was still thinking c#.
It's almost 5 and time to go home for me.
If it ain't broke don't fix it
Discover my world at jkirkerx.com
|
|
|
|
|
how to download unread mails in c#
|
|
|
|
|
DO NOT REPOST YOUR QUESTION
".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013
|
|
|
|
|
You're going to have to provide a lot more information than that. What type of email server is it that you want to pull the mail from?
This space for rent
|
|
|
|
|
daily based on (unread mails)different mails like... PDF,links,job related mails
|
|
|
|
|
And what have you tried so far, other than asking pretty much the same question on successive days?
Where are you stuck?
What help do you need?
Sent from my Amstrad PC 1640
Never throw anything away, Griff
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Thank you for answering a question I didn't ask. I asked what type of email server you were going to be pulling it from. How do you plan to connect to the server? Are you going to use POP3? SMTP? IMAP?
The approach you take will be different depending on which connection type you are using. For instance, POP3 isn't going to keep track of unread emails for you.
This space for rent
|
|
|
|
|
how to download unread mails in console applications.
|
|
|
|
|
What messages, download from where, webform or winform ... ?
|
|
|
|
|
|
Thank you for that comprehensive and informative answer.
|
|
|
|
|
|
I can't see the reason why this does not work. There is no clear indication what the error is.
public int CurrentHitPoints { get; set; }
public int MaximumHitPoints { get; set; }
public int Gold
{
get
{
return Gold;
}
set
{
if (value == 20)
{
value += 5;
Gold = value;
}
}
}
public int ExperiencePoints { get; set; }
public int Level { get; set; }
Brian
modified 29-May-19 15:12pm.
|
|
|
|
|
What do you mean by "is failing"?
|
|
|
|
|
I get this popup box
An unhandled exception of type 'System.StackOverflowException' occurred in Engine.dll
Engine is a container for player.cs
Brian
|
|
|
|
|
You are calling your get- and set-properties for "Gold" recursively.
|
|
|
|
|
This is the code that player.cs is called from.
I added a TEST button.
lblGold.text is a label on the form.
<pre lang="c#">
using Engine;
namespace SuperAdventure
{
public partial class SuperAdventure : Form
{
private Player _player;
public SuperAdventure()
{
InitializeComponent();
Location location = new Location(1, "Home", "This is your house.");
_player = new Player(10, 10, 20, 0, 1);
Update();
}
private void btnTest_Click(object sender, EventArgs e)
{
_player.Gold = 30;
// lblGold.Text = _player.Gold.ToString();
Update();
}
public void Update()
{
lblHitPoints.Text = _player.CurrentHitPoints.ToString();
lblGold.Text = _player.Gold.ToString();
lblExperience.Text = _player.ExperiencePoints.ToString();
lblLevel.Text = _player.Level.ToString();
}
}
}</pre>
|
|
|
|
|
Your highest priority should be to learn to use the debugger. It might sound advanced... but it isn't. You will be able to spot the course of errors like this in seconds - even without a heap of experience. Sure some errors will still be tricky... but if they are tricky with a debugger, they are pretty much impossible to solve without.
All you have to do is set a break point in the code you see a problem with (F9 in Visual Studio default key binding). Start the program with the debugger attached (F5) and reproduce the problem. Now you can step through the program line by line (F10/F11)- and you can see the values of all variables and fields at each line in the program.
Spotting the setter calling itself is trivial this way. As a beginner you might still want to ask help on how to solve a problem once you identified it - but at least you can ask a much more precise question when you know what the error is - and get help a lot easier.
So please - take the time to learn the debugger. The half hour will come back with interest of a few million percent.
|
|
|
|
|
I normally have an error message popup that tells me e exactly what is wrong (in most cases it's a spelling mistake) but this time this did not happen.
I have stepped through programs to see how they work. I could try doing that but I suspect all that would happen is the same message would pop up which does not tell me exactly what is wrong.
However a popup box with same message is better than nothing. I may need to research this message on the internet
Brian
|
|
|
|
|
Rule number 2 when troubleshooting (rule number one is "use the debugger") is not to assume anything. Assuming your debugger won't show you what is wrong is not the right approach.
What would happen if you had spend 10 seconds setting a breakpoint in the getter and setter and then kept pressing F11: You would see your code repeatedly call itself, while the callstack keeps growing one line each time it calls itself.
|
|
|
|
|
Error messages which tell you about spelling mistakes or other syntax errors are generated at compile time of your program. No executable is produced and therefore your program doesn't run.
A stack overflow condition can only occur when your program has been compiled and started running.
The debugger is the tool to be used for analyzing run time errors.
You should learn to understand the difference between these to error types.
|
|
|
|
|
There is no message you could possibly get that will tell you "exactly what is wrong" when the logic in your app is what is wrong. The error message you get can even be misleading.
Using the debugger to step through the code is THE most powerful tool you can use to find problems, not error messages. Error messages are a symptom of the problem, not the solution to it.
|
|
|
|
|
I created an error to test out the debugger.
I then pressed F5 to turn on the debugger, but when doing that the program compiles and tells me the error before I can step thought it.
Brian
|
|
|
|