| How do I get application full path & .exe? |
Try this:
string path = System.Reflection.Assembly.GetExecutingAssembly().Location.ToString();
It will return the full path and the name of the executable.
To get only the full path, you can use:
string pathOnly = Application.StartupPath.ToString(); |
|
|
|
|
|
| How to loop through a list of files in a directory? |
| This looks at all files ending in ".cs"
using System;
using System.IO;
public class Temp
{
public static void Main(string[] args) {
DirectoryInfo di = new DirectoryInfo(".");
foreach(FileInfo fi in di.GetFiles("*.cs")) {
Console.WriteLine("Looking at file \""+fi.FullName+"\"");
}
}
} |
|
|
|
|
|
| What is the GAC? What problem does it solve? |
| GAC stands for Global Access Cache where shareable/public assemblies (DLL) stored to be used by multiple programs. It gives a shared platform for programs to use single assembly and can store same assembly (of same name) with different versions and can help to solve DLL HELL. |
|
|
|
|
|
| What is the difference between an .EXE and a .DLL? |
| Exe is executable and independent program/process to run which has its own reserved memory space whereas DLL (Dynamic Link Library) is neither executable and not even independent, it used by other DLL/program. |
|
|
|
|
|
| Are private class-level variables inherited? |
| Yes, but they are not accessible, so looking at it you can honestly say that they are not inherited. But they are. |
|
|
|
|
|