I dont know why I totally forgot about this, but Cache is exactly what you're looking for
Can read more about it here
User Profile
Collapse
-
Here's an example usage of an event. Note that you can only invoke events in the class that defined them. If you have an item that you cannot reach you will need to write in a workaround.
[CODE=csharp]class TestClass
{
// Define the delegate
public delegate void MyExampleEventH andler(int aNumber, string aString);
// Declare the event
public MyExampleEventH andler TheEvent;...Leave a comment:
-
Ah I get what you are saying now.
I've never had that problem, and have no real good way of reproducing it here at home but from what I can gather you will need to go to VS2010 -> Debug -> Attach to process. Seems to be a bug or something.
Here is what I was reading...Leave a comment:
-
Yeah, given the behavior of it I would strongly advise against using a webservice for this. After thinking it over I think the better idea would be instead of a column for "LoggedIn" being a boolean, have it be the last time you talked with that user. Then just do a DB query for all users active within the last 10 minutes or so.
Its been a long time since I've worked with ASPX though so take my advice with a grain of salt...Leave a comment:
-
Im pretty sure its held in the session for that particular user but I could be wrong.
It is safe to hold it there, but I imagine there might be another method of holding onto who currently has an open session with your website. I would suggest a separate field in an existing users table on your DB or a new table altogether that lists (or reflects) who is online.
For instance, if you have a table with users/passwords/etc,...Leave a comment:
-
TRScheel replied to how to download files (2mb>) [server to client]using networkstream from a mailserver.in .NETPlease use [ code ] blocks for your code, makes it easier to make out.
Also, the thread.sleep seems a bit weird but maybe thats just out of place and Im not seeing it in context.
Have you tried getting the data in smaller chunks?Leave a comment:
-
Mind elaborating a bit more? A piece of example code would be useful too, to know where you are looking to debug and what you are doing.
It could be a simple as a try..catch block or something far more complicated, I just dont really know where you're going with your question is all.Leave a comment:
-
Does this happen on all CDs? Or just this one?
ReadByte() will return -1 if you are the end of the stream, granted 102400 is 102 Kb so WAY lower than what can fit on a CD.
I would try:
A) Checking Stream.CanSeek
and
B) Stream.Length to check the length of the streamLeave a comment:
-
Do the actual math in a seperate thread and off the main thread. If you overload the main thread it will not adequately update the form, sometimes even appearing to be locked up.Leave a comment:
-
While System.Reflecti on will work, its a fairly large tool to use if he is only dealing with a few classes.
To the OP, if you have less than half a dozen classes that might be involved, I would create a method that checked the type and then passed the value to a prewritten parse method in each class (which is really easy to write if you override ToString) and returned the class.
If you have something a bit more extensive...Leave a comment:
-
While great in theory in practice not so much. Little 10 line code snippets often have global variables. Larger projects would avoid them like the plague for almost everything but a few reserved instances (Settings for one).
Which leads to another point, just because you have the power to do something doesn't mean you should.
I saw a quote awhile back that read something like: QBasic gives you a spoon, VisualBasic...Leave a comment:
-
Based off my readings of the shunting yard algorithm (which is pretty cool imho) this should get you on the right road to doing what you want:
...Code:enum Operators { None = 0, AdditionSubtraction = 1, MultiplicationDivision = 5, ExponentRoot = 10 } static Operators GetOperatorWeight(char value) { if (value == '^') return Operators.ExponentRoot;Leave a comment:
-
-
Mine has bit math, hence its truthiness factor is way higher
=D...Leave a comment:
-
It makes perfect sense if you take a look at it from the view of bytes.
Skill1 = 0000 0001
Skill2 = 0000 0010
Skill3 = 0000 0100
Skill4 = 0000 1000
Skill5 = 0001 0000
Skill6 = 0010 0000
Skill7 = 0100 0000
Skill8 = 1000 0000
Now if skills available has 1, 2, 7, and 6 then you would have:
Skill1 | Skill2 | Skill7 | Skill 6
0000 0001
0000 0010...Leave a comment:
-
Try saying its real name two times fast.... quite the tongue twister.
Null coalescing operator...Leave a comment:
-
In addition VB .NET is quite verbose. It was designed from its inception (The basic languages) to be something of a 'learning language.'
Just putting my second on the fact that learning C#, as said above, makes learning C/C++, Java, PHP, and other languages easier. Many of them are based off much the same rules as C#.
Examples of code I particularly like that is difficult to implement in VB .NET:
...Code:Leave a comment:
-
-
TRScheel replied to How do i get a cross threaded call using the paralell extensions to update progressin .NETAfter looking up Parallel for quite a while (I have never seen that call before) I came across a few different resources.
It seems Parallel has been updated and is now part of LINQ. In addition I had read that it actually only ran on one thread, per this article here.
My guess is that you call Thread.Sleep on the same thread over and over again until it hangs.Leave a comment:
-
So you want to have the remote machine run a program continuously that would update a file with information about the system environment?
A couple ways you can do this. You can have the program write to a publicly read allowed file that updates periodically. If using this method I would suggest XML. Then have your central server render a page after retrieving all the remote XML files.
The other way to do this is to have...Leave a comment:
No activity results to display
Show More
Leave a comment: