Click here to Skip to main content
15,899,025 members
Home / Discussions / C#
   

C#

 
GeneralRe: minimizing and maximizing Pin
ummu 24-Jan-10 22:21
ummu 24-Jan-10 22:21 
QuestionHow to bookmark in ritchtextbox Pin
SuhebAhamd4-Jan-10 18:12
SuhebAhamd4-Jan-10 18:12 
AnswerRe: How to bookmark in ritchtextbox Pin
Pawel Gielmuda5-Jan-10 0:16
Pawel Gielmuda5-Jan-10 0:16 
AnswerRe: How to bookmark in ritchtextbox Pin
Eddy Vluggen5-Jan-10 10:29
professionalEddy Vluggen5-Jan-10 10:29 
QuestionWhat is the difference between Activator.CreateInstance and new operator ? Pin
md_azy4-Jan-10 17:45
md_azy4-Jan-10 17:45 
AnswerRe: What is the difference between Activator.CreateInstance and new operator ? Pin
_Maxxx_4-Jan-10 17:52
professional_Maxxx_4-Jan-10 17:52 
QuestionPrint Fit to Page Image Pin
rina184-Jan-10 15:45
rina184-Jan-10 15:45 
AnswerRe: Print Fit to Page Image Pin
AspDotNetDev4-Jan-10 17:56
protectorAspDotNetDev4-Jan-10 17:56 
QuestionMulti-color text in single cell of datagridview in C# Pin
auaryamane0074-Jan-10 15:21
auaryamane0074-Jan-10 15:21 
AnswerRe: Multi-color text in single cell of datagridview in C# [modified] Pin
petercrab5-Jan-10 0:11
petercrab5-Jan-10 0:11 
GeneralRe: Multi-color text in single cell of datagridview in C# Pin
auaryamane0075-Jan-10 13:32
auaryamane0075-Jan-10 13:32 
Questiontreeview allowdrop property not there Pin
CrimeanTurtle20084-Jan-10 12:31
CrimeanTurtle20084-Jan-10 12:31 
AnswerRe: treeview allowdrop property not there Pin
Mycroft Holmes4-Jan-10 13:34
professionalMycroft Holmes4-Jan-10 13:34 
GeneralRe: treeview allowdrop property not there Pin
CrimeanTurtle20084-Jan-10 13:42
CrimeanTurtle20084-Jan-10 13:42 
GeneralRe: treeview allowdrop property not there Pin
Mycroft Holmes4-Jan-10 14:01
professionalMycroft Holmes4-Jan-10 14:01 
GeneralRe: treeview allowdrop property not there Pin
CrimeanTurtle20084-Jan-10 14:20
CrimeanTurtle20084-Jan-10 14:20 
QuestionMovie from bmp files. bmp to tiff, mp4, or other formats Pin
ThorTheBraveGod4-Jan-10 8:43
ThorTheBraveGod4-Jan-10 8:43 
AnswerRe: Movie from bmp files. bmp to tiff, mp4, or other formats Pin
Migounette4-Jan-10 22:29
Migounette4-Jan-10 22:29 
GeneralRe: Movie from bmp files. bmp to tiff, mp4, or other formats Pin
ThorTheBraveGod5-Jan-10 6:32
ThorTheBraveGod5-Jan-10 6:32 
QuestionSliding Forms in windows mobile Pin
mahmoud ankeer4-Jan-10 7:14
mahmoud ankeer4-Jan-10 7:14 
QuestionRemoving values in a dictionary [modified] Pin
Paul Harsent4-Jan-10 4:55
Paul Harsent4-Jan-10 4:55 
I have a dictionary call timeDate. where DriveDT is an object.
static Dictionary<string, DriveDT> timeDate = new Dictionary<string, DriveDT>();

I want to remove the value from the dictionary, the line im using is in the section else //unload

But the line isnt working.
timeDate.Remove(key);

private static void extractSE(string filePath)
        {
            StreamReader textIn = new StreamReader(filePath);

            do
            {
                string text = textIn.ReadLine();

                bool mail = text.Contains("Mail");

               if(!mail)
                {
                if ((text != ""))
                {
                        int indexofTO = text.IndexOf("to");
                        int indexofSLOT = text.IndexOf("Slot");


                        if (indexofSLOT < indexofTO) //load
                        {
                            int indexofInfo = text.IndexOf("Info");
                            string dtTxt = text.Substring(0, (indexofInfo - 1));
                            DateTime dt = DateTime.Parse(dtTxt);
                            string data = text.Substring(indexofInfo);
                            string key = text.Substring(indexofSLOT, (indexofTO - indexofSLOT - 1));
                            timeDate.Add(key, new DriveDT(dt, data));

                        }
                        else //unload
                        {
                            string key = text.Substring((indexofTO + 2));
                            

                            timeDate.Remove(key);
                        } 
                }
                }
            }
            while (!textIn.EndOfStream);

        }


modified on Monday, January 4, 2010 11:30 AM

AnswerRe: Removing values in a dictionary Pin
Luc Pattyn4-Jan-10 5:12
sitebuilderLuc Pattyn4-Jan-10 5:12 
AnswerRe: Removing values in a dictionary Pin
OriginalGriff4-Jan-10 5:27
mveOriginalGriff4-Jan-10 5:27 
GeneralRe: Removing values in a dictionary Pin
Paul Harsent4-Jan-10 5:32
Paul Harsent4-Jan-10 5:32 
GeneralRe: Removing values in a dictionary Pin
Luc Pattyn4-Jan-10 5:32
sitebuilderLuc Pattyn4-Jan-10 5:32 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.