473,804 Members | 3,478 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Correct filename for events

Hi;

I have event logging working now (thank you all for the help). But we now
need to add doing this to our setup program. The file on my system is:
C:\WINDOWS\Micr osoft.NET\Frame work\v2.0.50727 \EventLogMessag es.dll

So my question is how do we programatically get this path and filename?
1) Where do we get the C:\WINDOWS\Micr osoft.NET\Frame work part from? Do we
just add Microsoft.NET\F ramework to the windows directory?
2) The v2.0.50727 part - do we build that from the AppDomain version number
or somewhere else?
3) Is the filename hardcoded as EventLogMessage s.dll?

I don't want our stuff to break if a new version comes out.

--
thanks - dave
david_at_windwa rd_dot_net
http://www.windwardreports.com

Cubicle Wars - http://www.windwardreports.com/film.htm
Nov 17 '06 #1
3 1136
Hey David,

You can get the current .NET Framework location using this call

string runtime =
System.Runtime. InteropServices .RuntimeEnviron ment.GetRuntime Directory()
--
Bits. Bytes.
http://bytes.thinkersroom.com
------------------------------
"David Thielen" wrote:
Hi;

I have event logging working now (thank you all for the help). But we now
need to add doing this to our setup program. The file on my system is:
C:\WINDOWS\Micr osoft.NET\Frame work\v2.0.50727 \EventLogMessag es.dll

So my question is how do we programatically get this path and filename?
1) Where do we get the C:\WINDOWS\Micr osoft.NET\Frame work part from? Do we
just add Microsoft.NET\F ramework to the windows directory?
2) The v2.0.50727 part - do we build that from the AppDomain version number
or somewhere else?
3) Is the filename hardcoded as EventLogMessage s.dll?

I don't want our stuff to break if a new version comes out.

--
thanks - dave
david_at_windwa rd_dot_net
http://www.windwardreports.com

Cubicle Wars - http://www.windwardreports.com/film.htm

Nov 17 '06 #2
Hi Dave,

You can use RuntimeEnvironm ent.GetRuntimeD irectory() to get the
C:\WINDOWS\Micr osoft.NET\Frame work\v2.0.50727 \ part.

#RuntimeEnviron ment.GetRuntime Directory Method
(System.Runtime .InteropService s)
http://msdn2.microsoft.com/en-us/lib...pservices.runt
imeenvironment. getruntimedirec tory.aspx

This is assuming you're creating the installer code in .NET. Let me know if
this is not the case.

For the "EventLogMessag es.dll", it should be pretty safe to hard code its
name.

Sincerely,
Walter Wang (wa****@online. microsoft.com, remove 'online.')
Microsoft Online Community Support

=============== =============== =============== =====
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications. If you are using Outlook Express, please make sure you clear the
check box "Tools/Options/Read: Get 300 headers at a time" to see your reply
promptly.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
=============== =============== =============== =====

This posting is provided "AS IS" with no warranties, and confers no rights.

Nov 17 '06 #3
Exactly what I needed - thanks

--
thanks - dave
david_at_windwa rd_dot_net
http://www.windwardreports.com

Cubicle Wars - http://www.windwardreports.com/film.htm


"Walter Wang [MSFT]" wrote:
Hi Dave,

You can use RuntimeEnvironm ent.GetRuntimeD irectory() to get the
C:\WINDOWS\Micr osoft.NET\Frame work\v2.0.50727 \ part.

#RuntimeEnviron ment.GetRuntime Directory Method
(System.Runtime .InteropService s)
http://msdn2.microsoft.com/en-us/lib...pservices.runt
imeenvironment. getruntimedirec tory.aspx

This is assuming you're creating the installer code in .NET. Let me know if
this is not the case.

For the "EventLogMessag es.dll", it should be pretty safe to hard code its
name.

Sincerely,
Walter Wang (wa****@online. microsoft.com, remove 'online.')
Microsoft Online Community Support

=============== =============== =============== =====
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications. If you are using Outlook Express, please make sure you clear the
check box "Tools/Options/Read: Get 300 headers at a time" to see your reply
promptly.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
=============== =============== =============== =====

This posting is provided "AS IS" with no warranties, and confers no rights.

Nov 18 '06 #4

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

Similar topics

0
2301
by: Tero Saarni | last post by:
I'm using Logging in my library module for producing trace log of certain events. For being more useful these log entries should be associated with the filename and line number of *users* code that was issuing the library call. This is similar to what Logging itself does since it doesn't print "logging/__init__.py" as value of %(filename) but instead it prints users file where logging method (info, error...) was called. What would be...
1
1806
by: mathlec | last post by:
I'm struggling with an odd problem and I want to validate something. What is the right way to load an assembly from bytes? Is this code correct? : .... Private Function loadBytes(filename as string) as Byte() Dim fs As New FileStream(filename, FileMode.Open) Dim buffer(CInt(fs.Length)) As Byte
1
1187
by: Deadly_M | last post by:
Is it possible to get the build / version number into the .exe or .msi filename ? ie. "mycode1.01.1091.exe" Thanx in advance _____________________________________ Matthew Purves , (Deadly_M)
7
1296
by: garyusenet | last post by:
Hi I have finally made progresss with my use of the open file dialog box! I have now made my own method that opens the dialog box and returns the file selected. Can you please have a quick look at the following code and tell me if what I have done is correct and good code. Thankyou very much : -
15
4329
by: Larry Bud | last post by:
I rarely crosspost, but this affects both ASP and Javascript REALLY odd bug that I ran across in ASP 3.0. I have an input type of file, user clicks browse, then places his cursor in the filename, puts a space at the end of the file, and uploads it. Web server doesn't translate the MIME type of document properly because it doesn't end with a valid extension, yet the file itself uploads successfully. I'm using SAFileUP for my uploading...
3
1172
by: luke.hoersten | last post by:
I'm looking for a good example of how to correctly abstract TK code from the rest of my program. I want to just get some user info and then get 4 values from the GUI. Right now I've written it OOP per the examples on python.org but it doesn't seem to be meshing very well with the rest of my project. Can anyone suggest some examples so that I can get more ideas? Thanks, Luke
0
1152
by: Darqer | last post by:
Hello There is a possibility to show DownloadFile form in web browser using following peace of code HttpContext context = HttpContext.Current; context.Response.ContentType = "application/octet-stream"; context.Response.AddHeader("Content-Disposition","attachment; filename=\"" + fileName + "\""); but there is somenthing missing because when I use filename with "#" it's displayed in wrong way as "_" in IE 7.0 (in firefox is OK). You...
0
1016
by: Darqer | last post by:
Hello There is a possibility to show DownloadFile form in web browser using following peace of code Code: ( text ) HttpContext context = HttpContext.Current; context.Response.ContentType = "application/octet-stream"; context.Response.AddHeader("Content-Disposition","attachment; filename=\"" + fileName + "\"");
7
1753
by: BiffMaGriff | last post by:
I have an query I run against an Oracle Connection. I have these objects, an event table and a table to map my objects to my events. My select statement selects the most recent event for each object and if it meets certain requirements then the object's id is returned. something like select o.id from objects o, events e, objecteventmap oem, (select max(date), o.id from events e, objects o, objecteventmap oem where e.id = oem.eventid...
0
9710
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10593
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10340
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10329
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10085
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7626
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6858
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5527
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
3
3000
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.