我有一个异常处理程序,每当出现错误时,它会向我们的帮助台软件发送电子邮件。邮件程序的所有属性都在app.config中处理。其中一个具有以下格式的属性 -> <add key="from" value="MATRIX@Exception.Handler"/>
有没有一种方法可以将值设置为 Environment.Username + @ourcompany.org
。
顺便提一下,这是一款仅限于内部使用的应用程序。
我有一个异常处理程序,每当出现错误时,它会向我们的帮助台软件发送电子邮件。邮件程序的所有属性都在app.config中处理。其中一个具有以下格式的属性 -> <add key="from" value="MATRIX@Exception.Handler"/>
有没有一种方法可以将值设置为 Environment.Username + @ourcompany.org
。
顺便提一下,这是一款仅限于内部使用的应用程序。
使用宏模式。 将值设置为[User] @Exception.Handler,然后将其包装在辅助方法中。在帮助器中添加String.Replace(“[User]”,Environment.Username),然后就可以使用了。
始终将配置值包装在辅助方法中。这样可以将字符串转换为其他类型,检查无效值,替换默认值等。配置文件经常不正确或损坏,导致难以诊断的运行时错误。
This is not possible.
You will need to modify the code that reads the value.
What is the use of default keyword in C#? Is it introduced in C# 3.0 ?
I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...
I m pretty new to the Objective-C world and I have a long history with .net/C# so naturally I m inclined to use my C# wits. Now here s the question: I feel really inclined to create some type of ...
I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...
I have two EF entities. One has a property called HouseNumber. The other has two properties, one called StartHouseNumber and one called EndHouseNumber. I want to create a many to many association ...
How to user GhostScript DLL to convert PDF to PDF/A. I know I kind of have to call the exported function of gsdll32.dll whose name is gsapi_init_with_args, but how do i pass the right arguments? BTW, ...
Since I cannot order my dictionary, what is the best way of going about taking key value pairs and also maintaing an index?
Maybe it s something I m doing wrong. I m just learning Linq because I m bored. And so far so good. I made a little program and it basically just outputs all matches (foreach) into a label control. ...