• Got a Tipila, google, windows live or facebook account ?
Tips tagged: c#
1
votes
This is how to get the full class name of the current class public string className { get { return GetType().FullName; } }
1
votes
Use following methods to read a text file in c# 1. using (StreamReader sr = File.OpenText(FILE_NAME)) { String input; while ((input = sr.ReadLine()) != null) { Console.WriteLine(input); } Console.WriteLine ("The end of the stream has been reached."); } 2 string text = System.IO.File.ReadAllText(@"C:\Users\Public\TestFo ...
1
votes
Use the following code to get the current time zone in the GMT + XX:XX format zone gives the time zone string zone = string.Empty; if (TimeZoneInfo.Local.BaseUtcOffset.TotalMinutes == 0) zone = " GMT"; else if (TimeZoneInfo.Local.BaseUtcOffset.TotalMinutes > 0) zone = " GMT + " + Math.Abs(TimeZoneInfo.Local.BaseUtcOffs ...
1
votes
Add 2 spaces to the beginning of each line to trick outlook not to remove line breaks in plain text emails. More info here
0
votes
Use this code to get the encrypted text of the forms authentication link. FormsAuthenticationTicket ticket = new FormsAuthenticationTicket(userName, false, 60); or FormsAuthenticationTicket ticket = new FormsAuthenticationTicket(1, username, DateTime.Now, DateTime.Now.AddMinutes(30), isPersistent, userData, FormsAuthen ...
1
votes
use the following to get the machine name in c# System.Environment.MachineName
6
Matching Tips
Search options
  • Use the syntax:
    seach text, tag1, tag2,...
    to search for tips with the given tags.
  • Add ,mytips to the search text to search within MyTips only.
  • Use the syntax:
    ,tag1, tag2,...  to get all tips with the given tags.
Login to Tipila