01.02.2011
Categories: .Net | Add a Comment
How can I determine the current language of the operating system in .Net? [/inline] string lng = System.Globalization.RegionInfo.CurrentRegion.TwoLetterISORegionName.ToLower(); [/inline] How can I set texts depending on the actual language of the operating system? Simply search for a language text file named by .Net Frameworks current region name in ISO format. [/inline] string lng = System.Globalization.RegionInfo.CurrentRegion.TwoLetterISORegionName.ToLower(); [...]
10.23.2010
The following code snippet shows an easy way to determine the root URL of a Web Application within the .Net Framework.
08.14.2010
Categories: Web Developer' s Kung-Fu | Add a Comment
Online Tools do your work in the browser Uncategorized browser tools Colorpicker http://www.colorschemer.com/online.html Here you pick realy nice Colors. Compress & Obfuscate JavaScript / CSS Compressor http://yui.2clics.net/ The YUI Compressor online Binary File to Base64 Encoder / Translator http://www.greywyvern.com/code/php/binary2base64 Use this tool to create data streams for embedding images (or any type of file) in [...]
04.04.2010
Categories: english | Add a Comment
public static T Clone(T source) { if (!typeof(T).IsSerializable) { throw new ArgumentException("The type must be serializable.", "source"); } if (Object.ReferenceEquals(source, null)) { return null; } IFormatter formatter = new BinaryFormatter(); Stream stream = new MemoryStream(); using (stream) { formatter.Serialize(stream, source); stream.Seek(0, SeekOrigin.Begin); return (T)formatter.Deserialize(stream); } }
04.04.2010
Categories: english | Add a Comment
protected void mail(){ string Server = "smtp.googlemail.com"; int port = 587; SmtpClient cl = new SmtpClient(Server, port); cl.EnableSsl = true; MailMessage msg = new MailMessage(); cl.Credentials = new System.Net.NetworkCredential("***@googlemail.com", "***"); { msg.From = new MailAddress("***@googlemail.com"); msg.To.Add(new MailAddress("***@googlemail.com")); msg.Subject = "test"; msg.IsBodyHtml = true; msg.Body = "test2"; } cl.Send(msg); }