View Single Post
  #1 (permalink)  
Old May 3rd, 2007, 02:42 PM
@shish @shish is offline
Authorized User
 
Join Date: Jan 2006
Location: gangtok, Sikkim, India.
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default Reading an INI file in C#

hi,
 I have this problem where i have put in data in a INI file using key value pairs....
eg.
  [section]
  userName=Mr A
  Email=https://www<number>.<URL>.com
  number=8,9
...

the problem that i am facing is that i want to use <number> as a key and assign a value ..could either be 8 or 9...from the C# code that i am using
...i have used [DllImport("kernel32")]
        private static extern long WritePrivateProfileString(string section, string key,string val,string filePath);

        [DllImport("kernel32")]
        private static extern int GetPrivateProfileString(string section,string key,string def, StringBuilder retVal,
            int size,string filePath);

in my C# code to access the data present.. i can access data using the regular key value pairs.. ie the userName by passing the key but simply cannot assign a value to the <number>...(which upto some extent i know must be used as a key) part of the URI.......
please could some body help me with this problem

achhetri
__________________
achhetri
Reply With Quote