Is it possible to spin off a thread in the Application_Start of the global.asax that will go into a loop and do work off of stuff it finds in the Application cache? Basically, I want it to check for some items, sleep for a few seconds and do it again... etc. Am I off my gord or is this obvious and I am just an idiot?
Wingnut74
Posts
-
Thread Question -
C# Noob in trouble with enumerationsI need to create an object that takes its values from a database. The value of the enum is stored as an int, and I need to convert it back to the enum as I build the object.
-
C# Noob in trouble with enumerationsDaniel Turini wrote: Now, it compiles, but does it work? Not always. What if numericThing has a value that is an invalid Thing? You should validate it before assigning. And that's why the C# compiler stopped you. Thanks to both of you. I figured it was something I was missing and was related to the way I have become used to VB's mommy-coddling. I am still a bit out of my comfort zone, but I see the truth of what you are saying. I just have some re-learning ahead of me. Thanks again.
-
C# Noob in trouble with enumerationsI am a moderately-skilled VB.NET guy who has (very) recently moved to C#. Where I seem to be having trouble is whenever I expect the same sort of forgiveness that VB seemed to give. It seems that enums in C# are not as flexible as they were in VB. I am not sure if this true, but I am struggling where I did not expect to. I have an enum that has int values. Basically, it is like this:
public enum Things {thing0 = 0, thing1 = 1, thing2 = 2}
... and so forth. What I can't do is this:int numericThing = 1; Things aThing; aThing = numericThing; // should be thing1, right?
This throws a CS0029 error about how it cannot implicitly convert type int to type Things. What am I missing? I mean, if it doesn't work this way? What's the point? I do not want to curl into the fetal position and crawl back to VB... -
Forms Threading QuestionOutstanding. Thanks!
-
Forms Threading QuestionI am not sure if this is the proper forum... I am looking to create a VB.NET based Forms App that will interact with a Web Service. I want to have a main/UI thread that spawns a thread to handle the web service. How do I then, communicate between the two once this is done? I will need to have the Web Service handling thread send information back to the UI, but also have the UI thread send new information back. Can someone point me in the right direction or to some articles? I haven't had much luck and, with what I have found, have more questions than answers.