using namespace System::Text;
String ^TCHARtoStr(TCHAR *temp) //TCHAR转String
{
array<unsigned char> ^lname=gcnew array<unsigned char>(128);
String ^lName;
Marshal::Copy(IntPtr(temp),lname,0,lname->Length);
int ii;
for(ii=0;ii<lname->Length;ii++)
if(lname[ii]==' ')
break;
lName=Encoding::Default->GetString(lname,0,ii);
delete lname;
return lName;
}
TCHAR* strName=(TCHAR*)(void*)Marshal::StringToHGlobalUni(Convert::ToString(this->textBox2->Text));