Attaching files to emails in .NET is easy if you’ve physically saved the file on the server. What if you don’t want to save the file, though? It’s actually pretty simple as well, but you need to convert the data to be attached into a Stream. The following code converts some plain old text into [...]
Monitor Log Files in Realtime with LogFileMonitor
In order to more easily monitor some web services that we have running, I whipped up a quick .NET app to monitor log files in real-time. I got a little bit carried away and wrote more than I needed, but I think this app will save a lot of time in the long run. The [...]
Working with dates in Flex AIR and SQLite
UPDATE 3/25/09: Paul Robertson from the AIR team stopped by and writes that declaring your SQLite column affinity (ie column type) as “DATE” will instruct AIR to handle all date conversions for you automatically. The problems I experienced mainly surfaced in a DataGrid when using a DateField and I have not had a chance to [...]
Send an Email via SMTP with C#
For whatever reason the web is filled with outdated examples of sending email with C#. This an example using .NET 2.0 First, be sure to import the Mail libs at the top of your class: using System.Net.Mail; Then in your code where the email will be sent: MailMessage msg = new MailMessage(); msg.From = new [...]
NHibernate.MappingException: Unknown entity class
The dreaded “NHibernate.MappingException: Unknown entity class” exception thrown by NHibernate in your .NET web application indicates that the class you are trying to map in your .hbm.xml file cannot be located for some reason. The first thing to check is to right-click on each of your .hbm.xml files and make sure the Build Action property [...]