Public string ReadFile (string path)
{
String tempContent = "";
Using (StreamReader sr = new StreamReader (path, System. Text. Encoding. GetEncoding ("gb2312 ")))
{
TempContent = sr. ReadToEnd ();
}
Return tempContent;
}
Private string TransfromXmlStringToHtml (string XmlString, string effectpath)
{
StringReader xml = new StringReader (XmlString );
XPathDocument xmlDoc = new XPathDocument (xml );
Extends compiledtransform xsl = new extends compiledtransform ();
Xsl. Load (effectpath );
String temp = "";
System. IO. Stream str = new System. IO. MemoryStream ();
Xsl. Transform (xmlDoc, null, str );
Str. Flush ();
Str. Position = 0;
Using (System. IO. StreamReader sr = new System. IO. StreamReader (str, System. Text. Encoding. GetEncoding ("GB2312 ")))
{
Temp = sr. ReadToEnd ();
};
Return temp;
}
Private string TransfromXmlToHtml (DataSet ds, string effectpath)
{
XmlDataDocument xmlDoc = new XmlDataDocument (ds );
Extends compiledtransform xsl = new extends compiledtransform ();
Xsl. Load (effectpath );
String temp = "";
System. IO. Stream str = new System. IO. MemoryStream ();
Xsl. Transform (xmlDoc, null, str );
Str. Flush ();
Str. Position = 0;
Using (System. IO. StreamReader sr = new System. IO. StreamReader (str, System. Text. Encoding. UTF8 ))
{
Temp = sr. ReadToEnd ();
};
Return temp;
}