V
Vincent
Hi, I have this code that the framework tells me that is obsolete(underlined), but I don't know how to replace it.
Can any1 help?
private void CreateIssuePage()
{
// This code created the HTML page displayed in the
// browser window
// Create the writer and serializer to save to disk
StreamWriter sw = new StreamWriter(System.Windows.Forms.Application.StartupPath + @"\Policy.xml");
XmlSerializer ser = new XmlSerializer(policy.GetType());
ser.Serialize(sw, policy);
sw.Close();
try
{// Transform the XML
XPathDocument xpd = new XPathDocument(System.Windows.Forms.Application.StartupPath + @"\Policy.xml");
XslTransform xslTrans = new XslTransform();
XsltArgumentList xsltArgList = new XsltArgumentList();
XmlTextWriter xtw = new XmlTextWriter(System.Windows.Forms.Application.StartupPath + @"\Policy.htm", null);
xslTrans.Load(System.Windows.Forms.Application.StartupPath + @"\Policy.xsl");
DateParser parser = new DateParser();
xsltArgList.AddExtensionObject("urnateParser", parser);
// This code has the obsolete attribute, will work with 1.0 and 1.1 FCL
xslTrans.Transform(xpd, xsltArgList, xtw);
xtw.Close();
}
catch(Exception exception)
{
ExceptionManager.Publish(exception);
}
// Load the newly created HTML file into the browser control
wb.Navigate("file://" + System.Windows.Forms.Application.StartupPath + @"/Policy.htm");
}
Can any1 help?
private void CreateIssuePage()
{
// This code created the HTML page displayed in the
// browser window
// Create the writer and serializer to save to disk
StreamWriter sw = new StreamWriter(System.Windows.Forms.Application.StartupPath + @"\Policy.xml");
XmlSerializer ser = new XmlSerializer(policy.GetType());
ser.Serialize(sw, policy);
sw.Close();
try
{// Transform the XML
XPathDocument xpd = new XPathDocument(System.Windows.Forms.Application.StartupPath + @"\Policy.xml");
XslTransform xslTrans = new XslTransform();
XsltArgumentList xsltArgList = new XsltArgumentList();
XmlTextWriter xtw = new XmlTextWriter(System.Windows.Forms.Application.StartupPath + @"\Policy.htm", null);
xslTrans.Load(System.Windows.Forms.Application.StartupPath + @"\Policy.xsl");
DateParser parser = new DateParser();
xsltArgList.AddExtensionObject("urnateParser", parser);
// This code has the obsolete attribute, will work with 1.0 and 1.1 FCL
xslTrans.Transform(xpd, xsltArgList, xtw);
xtw.Close();
}
catch(Exception exception)
{
ExceptionManager.Publish(exception);
}
// Load the newly created HTML file into the browser control
wb.Navigate("file://" + System.Windows.Forms.Application.StartupPath + @"/Policy.htm");
}