now, the first part of each line is a code, so that if the array was in any order, i could still find what i need. However, i want to turn this code into a string, because 222 doesn't mean anything to your average person. I have everything set up, but it wont compile because i cannot get my .ToString() or Convert.ToString() to work. Here is the code where I am receiving the error, help is much appreciated.
private void importRates()
string path = Settings.Default.FileName; //this["FileName"];
MessageBox.Show("no file found at " + path);
int lineCount = 0;
StreamReader sr = new StreamReader(path);
while ((line = sr.ReadLine()) != null)
string ToFrom = line.Split(','); // this was originally double.Parse(ToFrom);
rates[lineCount, 0] = ToFrom.ToString();
rates[lineCount, 1] = double.Parse(ToFrom);
rates[lineCount, 2] = double.Parse(ToFrom);
Today I found myself writing / reading binary image files, and I caught myself writing the following on a read:
using(fileReader = new BinaryReader(new FileStream(filePathName, FileMode.Open)))
//process the file here
Before I corrected my self, it got me thinking what exactly happens to anonymous instance members that are implementing the IDisposable interface? Would it be lost after the child instance is the finalized by sitting and waiting to be Garbage Collected? Or in the above example would the FileStream be picked up with the BinaryReader?
I do know that if you finalize the parent an instance is based off of, both get finalized... I know not as to what happens above???
This might even be a good article, if you could find it among the 1000's of hits on this topics keywords. plz send teh codez?
All your skynet questions[^] belong to solved I dislike the black-and-white voting system on questions/answers.
Only by writing your own class derived from progress bar and adding code to do that. So, labels are probably easiest
Please read this if you don't understand the answer I've given you
"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 have a Windows service in which I need to stop worker threads from my main thread. I am trying to use events to do this but I am stumped on why it is not working. Each class that runs a worker thread creates a stop event and a response event. When I need to stop the worker thread I call into the threads class and set the event. However, instead of the worker thread detecting that the event has been set and stopping gracefully, it just disappears. Why?
What is the best method for stopping a worker thread from the main thread?
I've been working on a windows mobile application that consists of a series of dynamically generated user forms and I was wondering if anyone knows how (following activation of the On-Screen Keyboard) I would get the currently selected form item to move up so it is above the OSK. Currently when the OSK is activated it obscures the active items and worse still completely obscures items at the bottom of the form. Its gotta be possible but I'm really stuck on how I would actually do it.
I'm pretty new to C# (<6mo) and especially to programming for mobile devices. Any help would be greatly appreciated. Hopefully the solution isn't staring me in the face
You may try setting the Top property of the selected control to a value above the keyboard showing.
For example, in the code below, I am changing the top property of the checkbox which gets hidden when the input panel is enabled:
What have you tried so far? We can't help without knowing what the exact problem is.
If you do a little research but don't understand, then ask about the part you don't understand. If you've written code that doesn't work right, and you don't know why (or you know why, but don't know how to fix it) then ask us for help.
There's not much good in making a statement of what you want to do, and then expecting to be given the code.
what happens behind the scene of statement, "yield return result"?
I think what happens is a object instance which implements IEnumerable (collection pattern) interface is created (but what is the type of the instance? some C# internal type?), and each time "yield return result" is called, a new element is inserted into the internal array of the instance. Any more reference documents?