yes. One, is file size, and i dont want the program to be loading all the stuff i dont need. File size saves time (downloading and running) and saving time means more users (most likley me and a bunch of friends) will want it to be fast, small, etc. Would it be possible to grab the process and set it to hid somehow through that? //Otis
Otis_69
Posts
-
hide console window -
Array object Emptyno problem... All these other people may be guru's, and thats why they dont understand that you want a simple answer... Where as i just learned that stuff a few weeks ago in college, and im new to C#, i can help you on a more "noob" level (no offense, if any)... Thats the problem with smart people and trying to help others, they think that we know a shitload of stuff, when they gotta think like the person they are helping... :P I've seen it happen too many times, id ask something, and a whole bunch of guru's will come along and say "do this, do that" and it gets so complicated, they seem to think im whining, when i just cant understand, and then they tell me i cant program C# anymore because i have to know everything... then a someone with just a bit more skill comes along, and tells me what to do... and im satisfied. I say that noone should ever ask a guru what might seem to be a simple question to them. Well, thats just my little grudge, ill prolly get flamed for it, and called a whiner, when im just stating my opinion, with some facts :P I just ignore them :P //Otis
-
hide console windowI know, but i made a console program, its an irc server, and now i want to make it use a tray icon, so you can tell tyhe status of the server, but i already coded 75% of it in console, and i cba to switch to a windows application... Isnt there a compiler directive to hide the console? //Otis
-
Force termination of a threadWell, i finally figured it out... In the IrcBot class, i made the variable holding the connection public. Then, before i started the thread, i grabbed that connection, and stored it in a variable. Then when i want to abort the thread, i use the variable and disconnect, and then abort :D It is kinda crude, but it works :D //Otis
-
Making a tray iconThankyou for uhh... notify'ing me of that :P //Otis
-
Array object EmptyTo determine if the object exists you do this:
if(yourobject != null) { //object doesnt exist, do something about it } else { //object does exist }
I hope you have the right word (exists) because an object that doesnt exist is just a name. If it does exist, then it has a refrence to a location in memory that holds the object. To test if the array is empty, do as the guy before me said, use yourarray.length() because by empty, i assume you mean the name exists, which holds a refrence to the object (so the object exists) but there is no data in the elements... //Otis -
Force termination of a threadWhat i did now, is i made an instance of a timer within my thread, and set the interval to 1 millisecond...
System.timers.timer t = new System.timers.timer(1);
Then i made the event handler thingt.Elapsed += new System.Timers.ElapsedEventHandler(t_Elapsed);
and the elapsed method looks like this:private void t_Elapsed(object sender, System.Timers.ElapsedEventArgs e) { if(System.Threading.Thread.CurrentThread.ThreadState.Equals(System.Threading.ThreadState.AbortRequested)) { connection.Disconnect("Gotta go!"); } }
Why wont that terminate the connection & die when i call abort from the main thread? //Otis -
Making a tray iconLets say i have a program, and i want ot be able to minimize it to the tray, so when the user right clicks on it, it brings up a menu. How would i do this? //Otis
-
hide console windowHey, me again, just wondering iff anyone knows how to get rid of the console window... Im making my forms dynamically, using a console application, but if the console window shows, it isnt as attractive... //Otis
-
Force termination of a threadOMG, this is my second time writing this, cause last time i wasnt logged in, and i clicked submit, and it said i needed to login, so i hit back to copy/paste my post into notepad, and it was gone... arrgh. Anyways: I have a class, lets call it "IrcBot". Now, i instanciate it like this:
IrcBot mybot = new IrcBot("server","channel","nick");
now, in my main class, i make a thread (or 10) all going to the same, or different irc servers... like this:Thread t = new Thread(new ThreadStart(mybot.connect)); t.Start();
seeing as there is no way to terminate the connection from the bot to the irc server, i cant terminate the thread, cause the thread is still doing something... In english, when i dot.Abort();
it doesnt stop and the bot is still in the irc server in that channel... How can i force the thread to stop regardless of whether its doing something or not? Thanks for the help :P //Otis