ube100
asked on
VB string function equivalent in c#...
How do i convert this vb code into c#
strTemp = String(255, Chr$(0))
strTemp = String(255, Chr$(0))
The '\0' part is the equivalent of the the Chr(0) function (ascii character NUL).
Btw, I assume you meant this as VB code, because the mentioned VB code will not compile (first parameter of constructor cannot be an Integer):
Dim strTemp As New String(Chr(0), 255)
Btw, I assume you meant this as VB code, because the mentioned VB code will not compile (first parameter of constructor cannot be an Integer):
Dim strTemp As New String(Chr(0), 255)
ASKER
next code is:
lRet = GetTempPath(255, strTemp)
API function for the GetTempPath is declared like this:
Private Declare Function GetTempPath Lib "Kernel32" Alias "GetTempPathA" (ByVal nBufferLength As Long, ByVal lpBuffer As String) As Long
How will I convert this into C#.
lRet = GetTempPath(255, strTemp)
API function for the GetTempPath is declared like this:
Private Declare Function GetTempPath Lib "Kernel32" Alias "GetTempPathA" (ByVal nBufferLength As Long, ByVal lpBuffer As String) As Long
How will I convert this into C#.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thank very much sir for help!!!
You're welcome, glad it helped :)
string strTemp = new string('\0', 255);