Hi,
I am using the below code to encode the content of *.ser file
foreach(string file inDirectory.EnumerateFiles("","*.SER")){byte[] content =File.ReadAllBytes( file ); xmlWriter.WriteStartElement("SerializedFile"); xmlWriter.WriteElementString("FileName",Path.GetFileName(file)); xmlWriter.WriteElementString("Content",System.Convert.ToBase64String( content )); xmlWriter.WriteEndElement();}
Now i have to decode the encoded content and create *.ser file, i tried with below code but the size of original *.ser file and generated *.ser file after i decode differs and if i check the content i can see some difference with the special characters.
encodedContent = xmlnode[i].ChildNodes.Item(1).InnerText;
byte[] data = Convert.FromBase64String(encodedContent);
string decodedContent = Encoding.UTF8.GetString(data);
Please help me out to solve this issue. Thanks in advance.
Regards,
Chetan.
Chetan Rajakumar