Click here to Skip to main content
15,921,840 members
Home / Discussions / C#
   

C#

 
QuestionDynamically created Icon for Number in Taskbar Pin
stancrm11-Oct-09 23:30
stancrm11-Oct-09 23:30 
AnswerRe: Dynamically created Icon for Number in Taskbar Pin
freakyit11-Oct-09 23:46
freakyit11-Oct-09 23:46 
GeneralRe: Dynamically created Icon for Number in Taskbar Pin
stancrm11-Oct-09 23:54
stancrm11-Oct-09 23:54 
GeneralRe: Dynamically created Icon for Number in Taskbar Pin
freakyit11-Oct-09 23:59
freakyit11-Oct-09 23:59 
AnswerRe: Dynamically created Icon for Number in Taskbar Pin
Luc Pattyn12-Oct-09 0:04
sitebuilderLuc Pattyn12-Oct-09 0:04 
Questionhow to cancel eventArgs Pin
Mr.Kode11-Oct-09 23:02
Mr.Kode11-Oct-09 23:02 
AnswerRe: how to cancel eventArgs Pin
stancrm11-Oct-09 23:41
stancrm11-Oct-09 23:41 
GeneralRe: how to cancel eventArgs Pin
freakyit11-Oct-09 23:49
freakyit11-Oct-09 23:49 
Question[Message Deleted] Pin
Swetha Srinivasan11-Oct-09 22:45
Swetha Srinivasan11-Oct-09 22:45 
AnswerRe: Title for the TableOfContents Pin
Md. Marufuzzaman11-Oct-09 23:23
professionalMd. Marufuzzaman11-Oct-09 23:23 
QuestionC# Attributes and methods Pin
manustone11-Oct-09 22:42
manustone11-Oct-09 22:42 
AnswerRe: C# Attributes and methods Pin
Simon P Stevens11-Oct-09 23:24
Simon P Stevens11-Oct-09 23:24 
AnswerRe: C# Attributes and methods Pin
Luc Pattyn12-Oct-09 0:08
sitebuilderLuc Pattyn12-Oct-09 0:08 
Question[Message Deleted] Pin
egpuyos11-Oct-09 22:04
egpuyos11-Oct-09 22:04 
AnswerRe: Dictionary Problem Pin
dan!sh 11-Oct-09 22:10
professional dan!sh 11-Oct-09 22:10 
GeneralRe: Dictionary Problem Pin
egpuyos11-Oct-09 22:12
egpuyos11-Oct-09 22:12 
GeneralRe: Dictionary Problem Pin
N a v a n e e t h11-Oct-09 22:17
N a v a n e e t h11-Oct-09 22:17 
GeneralRe: Dictionary Problem Pin
egpuyos11-Oct-09 22:28
egpuyos11-Oct-09 22:28 
Actually Sir, it was just my sample code, the real code I have is this.

I don't understand why that the dictionary when I call the method Exists, it will return false while it already contain the key that I passed? How could it happen?

Thank you again with you're help Sir.

using System;
using System.Collections.Generic;
using System.Text;

namespace ConsoleApplication1
{
    class Program
    {
        private static Dictionary<byte[], string> m_MyDictionary = null;
        private static System.Text.ASCIIEncoding m_MyEncoding = new ASCIIEncoding();

        static void Main(string[] args)
        {
            m_MyDictionary = new Dictionary<byte[], string>();
            AddDataToDictionary();
            Console.Write(Exists(m_MyEncoding.GetBytes("test 003")));
            Console.Read();
        }

        private static void AddDataToDictionary()
        {
            string s;
            byte[] myByte;

            s = "test 001";
            myByte = m_MyEncoding.GetBytes(s);
            m_MyDictionary.Add(myByte, s);

            s = "test 002";
            myByte = m_MyEncoding.GetBytes(s);
            m_MyDictionary.Add(myByte, s);

            s = "test 003";
            myByte = m_MyEncoding.GetBytes(s);
            m_MyDictionary.Add(myByte, s);

            s = "test 004";
            myByte = m_MyEncoding.GetBytes(s);
            m_MyDictionary.Add(myByte, s);

            s = "test 0021537912";
            myByte = m_MyEncoding.GetBytes(s);
            m_MyDictionary.Add(myByte, s);

            s = "test 327487";
            myByte = m_MyEncoding.GetBytes(s);
            m_MyDictionary.Add(myByte, s);
        }

        private static bool Exists(byte[] key)
        {
            return m_MyDictionary.ContainsKey(key);
        }
    }
}

GeneralRe: Dictionary Problem Pin
Luc Pattyn12-Oct-09 0:12
sitebuilderLuc Pattyn12-Oct-09 0:12 
GeneralRe: Dictionary Problem Pin
egpuyos11-Oct-09 22:14
egpuyos11-Oct-09 22:14 
GeneralRe: Dictionary Problem Pin
freakyit11-Oct-09 22:29
freakyit11-Oct-09 22:29 
Questionregarding auto generated mail in window application Pin
NarendraSinghJTV11-Oct-09 21:43
NarendraSinghJTV11-Oct-09 21:43 
AnswerRe: regarding auto generated mail in window application Pin
SeMartens11-Oct-09 21:49
SeMartens11-Oct-09 21:49 
GeneralRe: regarding auto generated mail in window application Pin
NarendraSinghJTV11-Oct-09 22:55
NarendraSinghJTV11-Oct-09 22:55 
QuestionProblem with RichText Box(Right Click Cut/Copy/Paste/SelectAll)... Pin
spalanivel11-Oct-09 21:41
spalanivel11-Oct-09 21:41 

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.