Infopath XML read and write

1.SHLF

       Stream source = properties.ListItem.File.OpenBinaryStream();

            byte[] buffer = new byte[source.Length];

            source.Read(buffer, 0, (Int32)source.Length);

            String filecontent=Encoding.UTF8.GetString(buffer);

            filecontent = filecontent.Replace("LFSH00001", GetLatestID());

            byte[] dest = Encoding.UTF8.GetBytes(filecontent);

            properties.ListItem.File.SaveBinary(dest);

 

posted @ 2009-12-25 15:19  玛雅人  阅读(174)  评论(0编辑  收藏  举报