473,396 Members | 2,033 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Nobody Knows about ReplacementStrings or is it just Google

I can´t find anything *usefull* about replacement strings, even on google!

Anyone know how to deal with the ReplacementStrings from the LogEntry class?

When you read a LogEntry.Messages that has extended characters or whatnot,
it throws an exception about converstion overflow - well, there is something
to do with replacementStrings, I just can´t figure how to get pass this.

I´ve tried the most absurd things to get through (I won´t even post what I
have tried or else my gene pool would be haunted by this for centuries).

any help is appreciated.


Jul 21 '05 #1
5 2020
<ca*****@hotmail.com> wrote in message
news:OY**************@TK2MSFTNGP10.phx.gbl...
I can´t find anything *usefull* about replacement strings, even on google!

Anyone know how to deal with the ReplacementStrings from the LogEntry class?
When you read a LogEntry.Messages that has extended characters or whatnot,
it throws an exception about converstion overflow - well, there is something to do with replacementStrings, I just can´t figure how to get pass this.

I´ve tried the most absurd things to get through (I won´t even post what I
have tried or else my gene pool would be haunted by this for centuries).


Which LogEntry class are you referring to?
--
John Saunders
johnwsaundersiii at hotmail
Jul 21 '05 #2
the System.Diagnostics.EventLogEntry

What I am doing is I am going through the log file, entry by entry, and
thats is fine, I can get all the data I need. But When I come across some
entries (with localized chars, like "não" it errors with an exception like
overflow exception of some sort)

It states in the documentation:
<sdk>
Remarks
Getting this property opens the registry to determine the filename of the
..dll file containing the localized text. If you receive a Registry error
when testing your source code, verify the .dll file's existence on the
computer. If insertion strings are included in the message, catch errors in
their allocation.

</sdk>

Now, so I catch the error, and there are strings in the ReplacementStrings
member of the eventlogentry.

Now what?

Which LogEntry class are you referring to?
--
John Saunders
johnwsaundersiii at hotmail

Jul 21 '05 #3
Hi Cablito,

Please to not double post I was sending this message to the other one.

I hope this helps anyhow?

Cor

Dim myEventLog As New Diagnostics.EventLog("System", ".")
Dim myLogEntryCollection As _
EventLogEntryCollection = myEventLog.Entries
For i As Integer = myLogEntryCollection.Count - 1 To 0 Step -1
Dim myLogEntry As EventLogEntry = myLogEntryCollection(i)
Dim mystrings() As String = myLogEntry.ReplacementStrings
For Each str As String In mystrings
Console.WriteLine(str)
Next
Next
Jul 21 '05 #4
Thanks, I´ll check that as soon as I get to my dev machine.

Ahh, I haven´t used newsgroups for the last god-knows how many years, double
posting is just unavoidable when u are desperate :) lol.

I wish I had all the time to cooperate more on newsgroups as I once did. I
almost feel bad about being helped when I haven´t helped anyone in ages ...
but thats just me.
"Cor Ligthert" <no**********@planet.nl> escreveu na mensagem
news:eD**************@TK2MSFTNGP09.phx.gbl...
Hi Cablito,

Please to not double post I was sending this message to the other one.

I hope this helps anyhow?

Cor

Dim myEventLog As New Diagnostics.EventLog("System", ".")
Dim myLogEntryCollection As _
EventLogEntryCollection = myEventLog.Entries
For i As Integer = myLogEntryCollection.Count - 1 To 0 Step -1
Dim myLogEntry As EventLogEntry = myLogEntryCollection(i)
Dim mystrings() As String = myLogEntry.ReplacementStrings
For Each str As String In mystrings
Console.WriteLine(str)
Next
Next

Jul 21 '05 #5
<ca*****@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
the System.Diagnostics.EventLogEntry

What I am doing is I am going through the log file, entry by entry, and
thats is fine, I can get all the data I need. But When I come across some
entries (with localized chars, like "não" it errors with an exception like
overflow exception of some sort)


First of all, I presume you're talking about the Message property (you
didn't say).

I suggest that you put a try-catch block around your access to the Message
property and display the complete exception and post it here:

Dim msg As String
Try
msg = evt.Message
Catch ex As Exception
Debug.WriteLine(ex.ToString())
End Try
--
John Saunders
johnwsaundersiii at hotmail
Jul 21 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: photoelectric | last post by:
When trying to run the below script on an apache/1.3.26 with mysql and php I get the following error message: Warning: mysql_connect() : Access denied for user: 'nobody@software-ece.rutgers.edu'...
1
by: | last post by:
Anyone know how to deal with the ReplacementStrings from the LogEntry class? When you read a LogEntry.Messages that has extended characters or whatnot, it throws an exception about converstion...
6
by: francescomoi | last post by:
Hi. My host decided to disallow mails from 'nobody' ('nobody' is the user of PHP+Apache) due to spam problems. I use the PHP mail function to send out a confirmation email for new users, and...
74
by: Suyog_Linux | last post by:
I wish to know how the free()function knows how much memory to be freed as we only give pointer to allocated memory as an argument to free(). Does system use an internal variable to store allocated...
5
by: | last post by:
I can´t find anything *usefull* about replacement strings, even on google! Anyone know how to deal with the ReplacementStrings from the LogEntry class? When you read a LogEntry.Messages that...
6
by: Peter Oliphant | last post by:
I've now asked how three times in this forum with no answers. So I went to the 'windowsforms' newsgroup, and found this post, also unanswered, with the same problem: "Hello, I've tried to...
7
by: Washington Moreira | last post by:
Hi All, I need help with ReplacementStrings on EventLog messages. The question is: How to replace things such %{SID} and %{GUID} inside EventLogEntry.Message? When the case is %{SID}, I...
3
by: Zim Babwe | last post by:
I posted the other day and so far no replies.... :-( I have a VB Windows Form (VS 2005) and on the form is a datagridview control. It was populated by: datagridview1.DataSource = tbl
4
by: Fro | last post by:
Hi, the operating system (Unix) considers a php-server as a user with name "nobody". For example, if my php-script saves a file uploaded by a user, the owner of the file will be "nobody". I...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.