Click here to Skip to main content
15,905,508 members
Home / Discussions / C#
   

C#

 
AnswerRe: Problem in Altering a dbf table , table corrupts Pin
esjq24-Jan-06 3:25
esjq24-Jan-06 3:25 
QuestionXML Treeview Pin
PHDENG8124-Jan-06 2:44
PHDENG8124-Jan-06 2:44 
AnswerRe: XML Treeview Pin
lmoelleb24-Jan-06 4:32
lmoelleb24-Jan-06 4:32 
AnswerRe: XML Treeview Pin
tarasn24-Jan-06 5:32
tarasn24-Jan-06 5:32 
Questionappsetting in .net 2.0 Pin
fmardani24-Jan-06 2:40
fmardani24-Jan-06 2:40 
AnswerRe: appsetting in .net 2.0 Pin
Le centriste24-Jan-06 3:59
Le centriste24-Jan-06 3:59 
Questionzooming an image in a picturebox Pin
NewbieDude24-Jan-06 1:39
NewbieDude24-Jan-06 1:39 
QuestionRemoving last line in a file Pin
rickell24-Jan-06 1:07
rickell24-Jan-06 1:07 
Hello, there. I'm looking for a way to remove the last tag in an XML file in a fairly quick manner. Here's the scenario. I have an XML file used as a session log of an application. You can include one or more session logs in the same file, so I have the following format for the XML:

<SessionLogs>
<SessionLog date="01/24/2006" time="6:45:31 AM">
<SessionEntry>
<Data> ... </Data>
</SessionEntry>
</SessionLog>
</SessionLogs>

The session log file can be quite large so I don't want to read it into an XMLDocument object, chop the last tag, and write the file back out just to remove one line from the file. Also, since the file can be large, I was hoping that I wouldn't have to parse through the whole thing to get to the end for one line. Does anyone know how this could be best accomplished? Is there a way to seek backwards through a file stream (i.e. after the file has been opened in Append mode) by one line and remove the line? Any suggestions would be greatly appreciated. Thanks.

Rick

-- modified at 7:53 Tuesday 24th January, 2006
AnswerRe: Removing last line in a file Pin
Le centriste24-Jan-06 4:06
Le centriste24-Jan-06 4:06 
GeneralRe: Removing last line in a file Pin
rickell24-Jan-06 7:38
rickell24-Jan-06 7:38 
AnswerRe: Removing last line in a file Pin
Le centriste24-Jan-06 7:44
Le centriste24-Jan-06 7:44 
GeneralRe: Removing last line in a file Pin
rickell24-Jan-06 9:36
rickell24-Jan-06 9:36 
AnswerRe: Removing last line in a file Pin
Le centriste24-Jan-06 9:53
Le centriste24-Jan-06 9:53 
Questionsmtp Pin
fmardani24-Jan-06 0:46
fmardani24-Jan-06 0:46 
Question1.1 to 2.0 Pin
fmardani23-Jan-06 23:47
fmardani23-Jan-06 23:47 
AnswerRe: 1.1 to 2.0 Pin
Mike Dimmick24-Jan-06 0:26
Mike Dimmick24-Jan-06 0:26 
GeneralRe: 1.1 to 2.0 Pin
fmardani24-Jan-06 0:29
fmardani24-Jan-06 0:29 
GeneralRe: 1.1 to 2.0 Pin
Mike Dimmick24-Jan-06 8:13
Mike Dimmick24-Jan-06 8:13 
QuestionHow to make messenger like popup messages Pin
User 231751423-Jan-06 23:43
User 231751423-Jan-06 23:43 
AnswerRe: How to make messenger like popup messages Pin
AB777124-Jan-06 0:22
AB777124-Jan-06 0:22 
GeneralRe: How to make messenger like popup messages Pin
User 231751424-Jan-06 1:15
User 231751424-Jan-06 1:15 
QuestionAbout design time support in inherited TextBox control Pin
Kamrul Hasan23-Jan-06 23:20
Kamrul Hasan23-Jan-06 23:20 
AnswerRe: About design time support in inherited TextBox control Pin
AB777124-Jan-06 2:06
AB777124-Jan-06 2:06 
QuestionPopUp form Pin
PHDENG8123-Jan-06 23:01
PHDENG8123-Jan-06 23:01 
AnswerRe: PopUp form Pin
AB777124-Jan-06 0:26
AB777124-Jan-06 0:26 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.