Click here to Skip to main content
16,011,475 members
Home / Discussions / C#
   

C#

 
GeneralArrayList Pin
20-Jan-02 23:09
suss20-Jan-02 23:09 
GeneralRe: ArrayList Pin
James T. Johnson21-Jan-02 7:47
James T. Johnson21-Jan-02 7:47 
GeneralInvoking loaded types Pin
18-Jan-02 20:58
suss18-Jan-02 20:58 
GeneralRe: Invoking loaded types Pin
James T. Johnson19-Jan-02 18:25
James T. Johnson19-Jan-02 18:25 
GeneralLVN_ODCACHEHINT and LVN_ODFINDITEM Pin
kasturirawat18-Jan-02 12:28
kasturirawat18-Jan-02 12:28 
General.NET scanners Pin
Not Active18-Jan-02 7:36
mentorNot Active18-Jan-02 7:36 
GeneralRe: .NET scanners Pin
Peter Stephens18-Jan-02 17:58
Peter Stephens18-Jan-02 17:58 
QuestionHow to get windows directory? Pin
17-Jan-02 10:50
suss17-Jan-02 10:50 
I need to read a .ini file under windows directory.
But the name of the directory may be different on different machines.
In some machine it is winnt while on ohters it is windows.
So, how to get the name of the directory.

I used GetPrivateProfileString with VC++. and I tried the whole
afternoon to get it worked under C# but it just cannot return the string.
the declaration of GetPrivateProfileString in VC++ is:
DWORD GetPrivateProfileString(
LPCTSTR lpAppName, // section name
LPCTSTR lpKeyName, // key name
LPCTSTR lpDefault, // default string
LPTSTR lpReturnedString, // destination buffer
DWORD nSize, // size of destination buffer
LPCTSTR lpFileName // initialization file name
);
And I converted it to
static extern int GetPrivateProfileString(
string appName, string keyName, sttring default, ref string strReturn,
int size, string fileName);
But I got System.NullReferenceException.

How to solve these two problems or any one of them?
AnswerRe: How to get windows directory? Pin
Navin17-Jan-02 11:03
Navin17-Jan-02 11:03 
GeneralRe: How to get windows directory? Pin
22-Jan-02 2:33
suss22-Jan-02 2:33 
GeneralRe: How to get windows directory? Pin
James T. Johnson22-Jan-02 4:31
James T. Johnson22-Jan-02 4:31 
GeneralInstalling Windows Service Pin
omkamal17-Jan-02 4:50
omkamal17-Jan-02 4:50 
GeneralRe: Installing Windows Service Pin
omkamal17-Jan-02 6:17
omkamal17-Jan-02 6:17 
GeneralSystem name using C# Pin
16-Jan-02 7:50
suss16-Jan-02 7:50 
GeneralRe: System name using C# Pin
Fazlul Kabir16-Jan-02 8:46
Fazlul Kabir16-Jan-02 8:46 
GeneralRe: System name using C# Pin
omkamal16-Jan-02 10:00
omkamal16-Jan-02 10:00 
GeneralRe: System name using C# Pin
omkamal17-Jan-02 2:36
omkamal17-Jan-02 2:36 
GeneralRe: System name using C# Pin
Fazlul Kabir17-Jan-02 2:46
Fazlul Kabir17-Jan-02 2:46 
GeneralRe: System name using C# Pin
omkamal17-Jan-02 4:19
omkamal17-Jan-02 4:19 
GeneralRe: System name using C# Pin
Fazlul Kabir17-Jan-02 4:48
Fazlul Kabir17-Jan-02 4:48 
GeneralRe: System name using C# Pin
Kelly Herald17-Jan-02 4:17
Kelly Herald17-Jan-02 4:17 
GeneralRe: System name using C# Pin
omkamal17-Jan-02 4:43
omkamal17-Jan-02 4:43 
GeneralRe: System name using C# Pin
Fazlul Kabir17-Jan-02 4:44
Fazlul Kabir17-Jan-02 4:44 
GeneralRe: System name using C# Pin
omkamal17-Jan-02 9:18
omkamal17-Jan-02 9:18 
GeneralVS.NET and Product Activation Pin
Alex Klinsky16-Jan-02 4:44
Alex Klinsky16-Jan-02 4:44 

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.