Possible Duplicate: C# - Convert a string of hex values to hex
我将以下法典从视力基础改为C#。 但是,我知道我如何在C#中使用Hex?
private string ConvertStringToHex(string sText)
{
int lCount;
string sHex;
string sResult;
for (lCount = 1; (lCount <= sText.Length); lCount++)
{
sHex = Hex(Convert.ToInt32(sText.Substring((lCount - 1), 1)));
if ((sHex.Length == 1))
{
sHex = ("0" + sHex);
}
sResult = (sResult + sHex);
}
return sResult;
}