Bitwise operators in c# OR(|), XOR(^), AND(&), NOT(~)
Testing Day (Loops)...
16 years ago
Just another developer Blog on the internet.... Talking to myself... Nobody listens...
// string[] -> ArrayList string[] msg = this.message.Split('\n'); ArrayList arrayList = new ArrayList(); arrayList.AddRange(msg); // ArrayList -> string[] string[] arrayStrings = arrayList.ToArray(typeof(string)) as string[];
str1.ToLower() == str2.ToLower()
string.Compare(str1, str2, true) == 0 //Ignoring cases
if (str == "")
if (str == string.Empty)
ArrayList intList = new ArrayList();
intList.add(10);
return (int)intList[0] + 20;
List intList = new List();
intList.add(10)
return intList[0] + 20;
if (object1 != null && object1.runMethod())
static class Program
{
[DllImport("user32.dll")]
[return: MarshalAs(UnmanagedType.Bool)]
static extern bool SetForegroundWindow(IntPtr hWnd);
///
/// The main entry point for the application.
///
[STAThread]
static void Main()
{
bool createdMutex = false;
Process currentProcess = Process.GetCurrentProcess();
Mutex mutex = new System.Threading.Mutex(true,
currentProcess.ProcessName + currentProcess.MachineName + " Mutex", out createdMutex);
if (createdMutex)
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Main());
GC.KeepAlive(mutex);
}
else
{
// Application to topmost window
foreach (Process process in Process.GetProcessesByName(currentProcess.ProcessName))
{
if (process.Id != currentProcess.Id)
{
SetForegroundWindow(process.MainWindowHandle);
break;
}
}
}
}
}
private ToolStripControlHost toolStripControlHost;
public WindowsFormConstructor()
{
InitializeComponent();
toolStripControlHost = new ToolStripControlHost(dateTimePicker1);
toolStrip1.Items.Add(toolStripControlHost);
}