base64 문자열이 포함 된 SOAP 응답이 나타납니다. 나는 이것이의 readUTF 기능Windows에서 base64 문자열 디코드 전화
public static String ReadUTF(BinaryReader reader)
{
// read the following string's length in bytes
int length = Helpers.FlipInt32(reader.ReadInt32());
// read the string's data bytes
byte[] utfString = reader.ReadBytes(length);
// get the string by interpreting the read data as UTF-8
return System.Text.Encoding.UTF8.GetString(utfString, 0, utfString.Length);
}
내 FlipInt32 기능입니다 그것은
public void main()
{
//****UPDATE
string data64 = "";
data64 = removeNewLinesFromString(data64);
content = data64.ToCharArray();
byte[] binaryData = Convert.FromBase64CharArray(content, 0, content.Length);
Stream stream = new MemoryStream(binaryData);
BinaryReader reader = new BinaryReader(stream,Encoding.UTF8);
string object64 = SoapSerializable.ReadUTF(reader);
}
을 읽을 수있는 요소의 값이 같은 기능을 얻을하여 XDocument를 사용하고
public static Int32 FlipInt32(Int32 value)
{
Int32 a = (value >> 24) & 0xFF;
Int32 b = (value >> 16) & 0xFF;
Int32 c = (value >> 8) & 0xFF;
Int32 d = (value >> 0) & 0xFF;
return (((((d << 8) | c) << 8) | b) << 8) | a;
}
하지만, 결과 값은 온라인 디코더가 제공 한 결과와 약간 다릅니다.
내가 여기에 뭔가를 찾을 수 있습니까?
당신의 base64로 문자열 인에서
this is a dummy encoded base64 string
을 얻기 위해 무엇입니까? 어떻게 해독합니까? XDocument는 어떻게 사용합니까? BinaryReader의 사용법은 무엇입니까? –UTF8 인코딩과 base64 인코딩을 관련시키는 방법은 무엇입니까? –
L.B 내 질문을 업데이트했습니다. 햄릿 하코 비앙, 너 무슨 뜻인지 설명해 줄 수있어? – Billatron