C
Curt Krueger
Hello,
Long day for me, so apologies in advance if I'm asking where the trees
are in the middle of the forest.
I have wrote a errorlog object that stores it's data in XML format. What
I'm wanting to do is stream the XML through the web service, then to a
request made by ASP.NET.
I have successfully written one that will transmit it in binary format (see
code below), but what I'd like to is send it in its native format, XML plain
text. The ASP.NET consumer could then either parse it, or simply offer up
saving to disk.
Regards,
Curt
======================
Any web pages/code examples to do the following, only in "text" or format?
public byte[] GetErrorLog()
{
if (!File.Exists(LogPathAndFileName))
return null;
FileStream file = null;
try
{
//ensures one thread has access at a time
Monitor.Enter(this);
file = new FileStream(LogPathAndFileName, FileMode.Open);
byte[] fileStream = new byte[file.Length];
file.Read(fileStream, 0, (int)file.Length);
file.Close();
return fileStream;
}
catch (Exception ex)
{
return null;
}
finally
{
if (null != file)
file.Close();
Monitor.Exit(this);
}
}
Long day for me, so apologies in advance if I'm asking where the trees
are in the middle of the forest.
I have wrote a errorlog object that stores it's data in XML format. What
I'm wanting to do is stream the XML through the web service, then to a
request made by ASP.NET.
I have successfully written one that will transmit it in binary format (see
code below), but what I'd like to is send it in its native format, XML plain
text. The ASP.NET consumer could then either parse it, or simply offer up
saving to disk.
Regards,
Curt
======================
Any web pages/code examples to do the following, only in "text" or format?
public byte[] GetErrorLog()
{
if (!File.Exists(LogPathAndFileName))
return null;
FileStream file = null;
try
{
//ensures one thread has access at a time
Monitor.Enter(this);
file = new FileStream(LogPathAndFileName, FileMode.Open);
byte[] fileStream = new byte[file.Length];
file.Read(fileStream, 0, (int)file.Length);
file.Close();
return fileStream;
}
catch (Exception ex)
{
return null;
}
finally
{
if (null != file)
file.Close();
Monitor.Exit(this);
}
}