K
Key
Hi Here is my problem:
I have a project that was exported in .xml file from MS Project 2007. I have
a web form that contains a text field with a full path to this .xml file and
a button. When I click the button I want the MS Project 2007 to open on the
client machine a show me the project from this .xml file.
I have this code, but It doesn't work unfortunately:
context.Response.ContentType = "application/vnd.ms-project";
System.IO.FileStream fs = new System.IO.FileStream (
context.Request.QueryString["filename"], System.IO.FileMode.Open,
System.IO.FileAccess.Read );
System.IO.StreamReader reader = new System.IO.StreamReader ( fs );
string data = reader.ReadToEnd ();
byte[] dataBuffer = System.Text.Encoding.UTF8.GetBytes ( data );
reader.Close ();
fs.Close ();
context.Response.Write ( result.ToString());
I'm digging this problems about 2 or 3 days and found one incomplete solution:
ApplicationClass PjApp = new ApplicationClass ();
//I don't know the right syntax to call this method, no information in help
bool result = PjApp.FileSaveAs ( context.Request.QueryString["filename"],
PjFileFormat.pjMPP, null, null, null, null, null, null, null, null, null,
null, null, null, null, null, null, null, null );
1. How can I open the project from the .xml file on the client machine using
web forms C#?
2. What is the correct syntax of methods Application.FileOpen and
Application.FileSaveAs?
thanks for the help
I have a project that was exported in .xml file from MS Project 2007. I have
a web form that contains a text field with a full path to this .xml file and
a button. When I click the button I want the MS Project 2007 to open on the
client machine a show me the project from this .xml file.
I have this code, but It doesn't work unfortunately:
context.Response.ContentType = "application/vnd.ms-project";
System.IO.FileStream fs = new System.IO.FileStream (
context.Request.QueryString["filename"], System.IO.FileMode.Open,
System.IO.FileAccess.Read );
System.IO.StreamReader reader = new System.IO.StreamReader ( fs );
string data = reader.ReadToEnd ();
byte[] dataBuffer = System.Text.Encoding.UTF8.GetBytes ( data );
reader.Close ();
fs.Close ();
context.Response.Write ( result.ToString());
I'm digging this problems about 2 or 3 days and found one incomplete solution:
ApplicationClass PjApp = new ApplicationClass ();
//I don't know the right syntax to call this method, no information in help
bool result = PjApp.FileSaveAs ( context.Request.QueryString["filename"],
PjFileFormat.pjMPP, null, null, null, null, null, null, null, null, null,
null, null, null, null, null, null, null, null );
1. How can I open the project from the .xml file on the client machine using
web forms C#?
2. What is the correct syntax of methods Application.FileOpen and
Application.FileSaveAs?
thanks for the help