Click here to Skip to main content
15,883,883 members
Home / Discussions / C#
   

C#

 
AnswerRe: Need your opinion on querying data for presentation on winforms / web page and for reports Pin
Abhinav S8-May-13 21:13
Abhinav S8-May-13 21:13 
Questionhow to develop a client server encrypt commincation using one time pad Pin
Member 100380688-May-13 10:21
Member 100380688-May-13 10:21 
AnswerRe: how to develop a client server encrypt commincation using one time pad Pin
Eddy Vluggen8-May-13 10:54
professionalEddy Vluggen8-May-13 10:54 
GeneralRe: how to develop a client server encrypt commincation using one time pad Pin
Member 100380688-May-13 11:04
Member 100380688-May-13 11:04 
GeneralRe: how to develop a client server encrypt commincation using one time pad Pin
Eddy Vluggen8-May-13 11:14
professionalEddy Vluggen8-May-13 11:14 
QuestionEffective Coding Style to build a Class Library Pin
Bikash Prakash Dash8-May-13 9:55
Bikash Prakash Dash8-May-13 9:55 
AnswerRe: Effective Coding Style to build a Class Library Pin
Eddy Vluggen8-May-13 10:48
professionalEddy Vluggen8-May-13 10:48 
QuestionHelp with mutex, cannot get mutex to work Pin
turbosupramk38-May-13 7:06
turbosupramk38-May-13 7:06 
This always returns true, whether I have notepad open or not, can anyone tell me what I'm doing wrong?


C#
if (IsSingleInstance())
           {
               Application.EnableVisualStyles();
               Application.SetCompatibleTextRenderingDefault(false);
               Application.Run(new Form1(Args));
           }
           else
           {
               Process current = Process.GetCurrentProcess();
               foreach (Process process in Process.GetProcessesByName(current.ProcessName))
               {
                   if (process.Id != current.Id)
                   {
                       SetForegroundWindow(process.MainWindowHandle);
                       break;
                   }
               }
           }



static Mutex _m;

C#
[STAThread]
        static void Main(string[] Args)
        {

static bool IsSingleInstance()
    {
        try
        {
            // Try to open existing mutex.
            Mutex.OpenExisting(@"Global\Notepad");
        }
        catch
        {
            // If exception occurred, there is no such mutex.
            Program._m = new Mutex(true, "Notepad");

            // Only one instance.
            return true;
        }
        // More than one instance.
        return false;
    }
}

AnswerRe: Help with mutex, cannot get mutex to work Pin
Jasmine25018-May-13 7:38
Jasmine25018-May-13 7:38 
GeneralRe: Help with mutex, cannot get mutex to work Pin
turbosupramk38-May-13 7:49
turbosupramk38-May-13 7:49 
AnswerRe: Help with mutex, cannot get mutex to work Pin
Dave Kreskowiak8-May-13 8:10
mveDave Kreskowiak8-May-13 8:10 
GeneralRe: Help with mutex, cannot get mutex to work Pin
turbosupramk38-May-13 8:31
turbosupramk38-May-13 8:31 
GeneralRe: Help with mutex, cannot get mutex to work Pin
Jasmine25018-May-13 8:35
Jasmine25018-May-13 8:35 
GeneralRe: Help with mutex, cannot get mutex to work Pin
Dave Kreskowiak8-May-13 8:53
mveDave Kreskowiak8-May-13 8:53 
GeneralRe: Help with mutex, cannot get mutex to work Pin
turbosupramk310-May-13 1:58
turbosupramk310-May-13 1:58 
GeneralRe: Help with mutex, cannot get mutex to work Pin
Dave Kreskowiak10-May-13 2:17
mveDave Kreskowiak10-May-13 2:17 
Questionlogin authentication Pin
geo thomas8-May-13 0:08
professionalgeo thomas8-May-13 0:08 
AnswerRe: login authentication Pin
Sivaraman Dhamodharan8-May-13 0:22
Sivaraman Dhamodharan8-May-13 0:22 
GeneralRe: login authentication Pin
geo thomas8-May-13 0:30
professionalgeo thomas8-May-13 0:30 
GeneralRe: login authentication Pin
Dave Kreskowiak8-May-13 2:05
mveDave Kreskowiak8-May-13 2:05 
GeneralRe: login authentication Pin
geo thomas8-May-13 20:06
professionalgeo thomas8-May-13 20:06 
GeneralRe: login authentication Pin
Dave Kreskowiak9-May-13 1:37
mveDave Kreskowiak9-May-13 1:37 
GeneralRe: login authentication Pin
geo thomas9-May-13 19:00
professionalgeo thomas9-May-13 19:00 
Questionrunning asp.net website in a windows application Pin
mrkeivan7-May-13 22:25
mrkeivan7-May-13 22:25 
AnswerRe: running asp.net website in a windows application Pin
Dave Kreskowiak8-May-13 2:06
mveDave Kreskowiak8-May-13 2:06 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.