473,508 Members | 2,140 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2022
<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
49525
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
1738
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
1754
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
3943
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
946
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
5043
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
3116
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
1159
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
2685
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...
0
7331
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
7391
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
7501
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5633
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,...
1
5056
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...
0
4713
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3204
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1564
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
768
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.