Click here to Skip to main content
15,898,538 members
Home / Discussions / C#
   

C#

 
AnswerRe: Convert binary data to comma delimited string Pin
darkelv27-Jul-06 2:18
darkelv27-Jul-06 2:18 
GeneralRe: Convert binary data to comma delimited string Pin
Guffa27-Jul-06 7:27
Guffa27-Jul-06 7:27 
QuestionOPENROWSET Problem ! Pin
coolestCoder27-Jul-06 1:50
coolestCoder27-Jul-06 1:50 
QuestionHow to insert picture into excel by c#? Pin
Mirjana_b27-Jul-06 1:27
Mirjana_b27-Jul-06 1:27 
Questionpolygon intersection Pin
praveenqwe27-Jul-06 1:17
praveenqwe27-Jul-06 1:17 
AnswerRe: polygon intersection Pin
J4amieC27-Jul-06 2:18
J4amieC27-Jul-06 2:18 
Question.ini files Pin
Fuhrer27-Jul-06 1:00
Fuhrer27-Jul-06 1:00 
AnswerRe: .ini files Pin
-Dy27-Jul-06 2:51
-Dy27-Jul-06 2:51 
There's nothing wrong with your code, I've just tried it (see below) and it works fine.

using System.Text; // For StringBuilder
using System.Runtime.InteropServices; // For DllImport

// class declaration and all that jazz here

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

		StringBuilder stb = new StringBuilder(250);
		private void Form1_Load(object sender, System.EventArgs e)
		{
			GetPrivateProfileString("mySect", "item", "def_", stb, 250, @"c:\temp\myfile.ini");
			stb = stb; // a line for me to set a breakpoint in
		}


I set a breakpoint on the stb = stb; line, and used quick view to look at the object - my INI file data is there.

Therefore... double check the path to your INI file, double check the INI file is in the correct format. My enable files looks like this:

[mySect]
item=notDEFAULT


Hope that helps.



- Dy

QuestionInsert file in DB Pin
mehrdadc4827-Jul-06 0:08
mehrdadc4827-Jul-06 0:08 
AnswerRe: Insert file in DB Pin
User 167325227-Jul-06 15:18
User 167325227-Jul-06 15:18 
QuestionNew vc# project-- Loading the .projdata file failed Pin
gbabu1726-Jul-06 23:52
gbabu1726-Jul-06 23:52 
QuestionFinding Local IP Endpoint Pin
aruna_koride26-Jul-06 23:39
aruna_koride26-Jul-06 23:39 
AnswerRe: Finding Local IP Endpoint Pin
Mike Dimmick27-Jul-06 0:53
Mike Dimmick27-Jul-06 0:53 
QuestionForm on client Pin
hpetriffer26-Jul-06 23:30
hpetriffer26-Jul-06 23:30 
Questionadding a new cell into DataGridView ? help please ... Pin
cmpeng3426-Jul-06 23:22
cmpeng3426-Jul-06 23:22 
AnswerRe: adding a new cell into DataGridView ? help please ... Pin
Mairaaj Khan27-Jul-06 1:06
professionalMairaaj Khan27-Jul-06 1:06 
QuestionDisplaying Images into Crystal reports Pin
bahaa_sa526-Jul-06 23:20
bahaa_sa526-Jul-06 23:20 
QuestionHow to use my C# function in Crystal Report? Pin
bahaa_sa526-Jul-06 23:19
bahaa_sa526-Jul-06 23:19 
AnswerRe: How to use my C# function in Crystal Report? Pin
stancrm27-Jul-06 0:55
stancrm27-Jul-06 0:55 
QuestionDrawing Pixels in Asp.Net And C# Pin
anand80vns26-Jul-06 23:08
anand80vns26-Jul-06 23:08 
Questionstore datagrid data in a database Pin
00thilani26-Jul-06 22:55
00thilani26-Jul-06 22:55 
AnswerRe: store datagrid data in a database Pin
goyal manish26-Jul-06 23:28
goyal manish26-Jul-06 23:28 
Questionhow to delete the text file contents using C# Pin
minchoo26-Jul-06 22:45
minchoo26-Jul-06 22:45 
AnswerRe: how to delete the text file contents using C# Pin
Ed.Poore26-Jul-06 23:52
Ed.Poore26-Jul-06 23:52 
Questioncompiling projects which refer dlls! Pin
samtam26-Jul-06 22:21
samtam26-Jul-06 22:21 

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.