sitg
asked on
I have a problem I want to convert vb code to c# code
public object URLDecode(string What)
{
object functionReturnValue = null;
int Pos;
int pPos;
What = What.ToString().Replace("+ ", " ");
StringReader Stream = new StringReader(What);
ErrorEventArgs Err;
if (Convert.ToInt64(Err) == 0) {
Pos = What.ToString().IndexOf("% ",1);
pPos = 1;
while (Pos > 0) {
pPos = Pos + 3;
Pos = What.ToString().IndexOf("% ", pPos);
}
Stream.WriteText(Strings.M id(What, pPos));
Stream.Position = 0;
functionReturnValue = Stream.ReadToEnd();//.Read Text;
Stream.Close();
}
else {
Pos = What.ToString().IndexOf("% ", 1);
while (Pos > 0) {
What = Strings.Left(What, Pos - 1) + Strings.Chr((long)"&H" + Strings.Mid(What, Pos + 1, 2)) + Strings.Mid(What, Pos + 3);
Pos = Pos + 1;
Pos = What.ToString().IndexOf("% ", Pos);
}
functionReturnValue = What;
}
Stream = null;
return functionReturnValue;
}
{
object functionReturnValue = null;
int Pos;
int pPos;
What = What.ToString().Replace("+
StringReader Stream = new StringReader(What);
ErrorEventArgs Err;
if (Convert.ToInt64(Err) == 0) {
Pos = What.ToString().IndexOf("%
pPos = 1;
while (Pos > 0) {
pPos = Pos + 3;
Pos = What.ToString().IndexOf("%
}
Stream.WriteText(Strings.M
Stream.Position = 0;
functionReturnValue = Stream.ReadToEnd();//.Read
Stream.Close();
}
else {
Pos = What.ToString().IndexOf("%
while (Pos > 0) {
What = Strings.Left(What, Pos - 1) + Strings.Chr((long)"&H" + Strings.Mid(What, Pos + 1, 2)) + Strings.Mid(What, Pos + 3);
Pos = Pos + 1;
Pos = What.ToString().IndexOf("%
}
functionReturnValue = What;
}
Stream = null;
return functionReturnValue;
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER