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

C#

 
GeneralRe: Help in Regular expressions Pin
shankbond1-Jul-10 18:24
shankbond1-Jul-10 18:24 
GeneralRe: Help in Regular expressions Pin
OriginalGriff1-Jul-10 21:49
mveOriginalGriff1-Jul-10 21:49 
GeneralRe: Help in Regular expressions Pin
shankbond4-Jul-10 1:10
shankbond4-Jul-10 1:10 
GeneralRe: Help in Regular expressions Pin
OriginalGriff1-Jul-10 22:04
mveOriginalGriff1-Jul-10 22:04 
GeneralRe: Help in Regular expressions Pin
shankbond4-Jul-10 1:08
shankbond4-Jul-10 1:08 
GeneralRe: Help in Regular expressions Pin
shankbond5-Jul-10 21:31
shankbond5-Jul-10 21:31 
QuestionLogin with access token in C# Pin
Etienne_1231-Jul-10 6:29
Etienne_1231-Jul-10 6:29 
QuestionTrying to Shut Down application Pin
PDTUM1-Jul-10 5:19
PDTUM1-Jul-10 5:19 
Good Morning,

I feel like Dr Frankenstein; I created this monster and now I cannot shut it off! Case in point. My application begins with a Splash screen that retrieves information (Connections Strings, Permissions) and sets a switch in a remote database that defines the users status as active. I hide this page when I advance to the next page (The Main Page). Now, I try to shut it down. I call a method from the Form_Closing event so that I can reset the users status as inactive and I use Application.Exit() as the closing command. BUT....my back trace shows that the script re runs the Splash page and turns the switch in the remote database back to active again before it closes. NOW.... when the user goes to log back on again, the system denies him access with the response that he is already active. In essence, the function of the code is to discourage a hacked application from being able to open if the original application is already active. It's a just in case scenario. SO...what to do? Thanks, Pat

<br />
private void frmMain_FormClosing(object sender, FormClosingEventArgs e)<br />
        {<br />
            if (alreadyClosing)<br />
                {<br />
                    return;<br />
                }<br />
<br />
            //If there are results posted<br />
            if (richTextResult.Text != string.Empty)<br />
            {<br />
                DialogResult answer;<br />
                string message1 = "Are you sure you want to exit the program? " +<br />
                    "\n\nThe information in your Result box will be lost!";<br />
                answer = MessageBox.Show(message1, "Exit?", MessageBoxButtons.YesNo, MessageBoxIcon.Question);<br />
                if (answer == DialogResult.No)<br />
                {<br />
                    e.Cancel = true;                    <br />
                    return;<br />
                }<br />
                else<br />
                {<br />
                    ResetDatabaseActivity();<br />
                    alreadyClosing = true;<br />
                    Application.Exit();<br />
                }<br />
            }<br />

AnswerRe: Trying to Shut Down application Pin
I Believe In GOD1-Jul-10 5:37
I Believe In GOD1-Jul-10 5:37 
AnswerRe: Trying to Shut Down application Pin
PDTUM1-Jul-10 6:06
PDTUM1-Jul-10 6:06 
QuestionCant use System.Windows Pin
ayandelhi1-Jul-10 4:46
ayandelhi1-Jul-10 4:46 
AnswerRe: Cant use System.Windows Pin
Pete O'Hanlon1-Jul-10 4:50
mvePete O'Hanlon1-Jul-10 4:50 
GeneralRe: Cant use System.Windows Pin
ayandelhi1-Jul-10 4:53
ayandelhi1-Jul-10 4:53 
GeneralRe: Cant use System.Windows Pin
Paladin20001-Jul-10 5:30
Paladin20001-Jul-10 5:30 
AnswerRe: Cant use System.Windows Pin
Richard MacCutchan1-Jul-10 4:55
mveRichard MacCutchan1-Jul-10 4:55 
GeneralRe: Cant use System.Windows Pin
ayandelhi1-Jul-10 4:58
ayandelhi1-Jul-10 4:58 
GeneralRe: Cant use System.Windows [modified] Pin
Richard MacCutchan1-Jul-10 5:38
mveRichard MacCutchan1-Jul-10 5:38 
GeneralRe: Cant use System.Windows Pin
Paladin20001-Jul-10 8:40
Paladin20001-Jul-10 8:40 
GeneralRe: Cant use System.Windows Pin
Richard MacCutchan1-Jul-10 9:51
mveRichard MacCutchan1-Jul-10 9:51 
AnswerRe: Cant use System.Windows Pin
ayandelhi1-Jul-10 5:22
ayandelhi1-Jul-10 5:22 
Questionfixed scope Pin
Chesnokov Yuriy1-Jul-10 0:46
professionalChesnokov Yuriy1-Jul-10 0:46 
AnswerRe: fixed scope Pin
Luc Pattyn1-Jul-10 0:55
sitebuilderLuc Pattyn1-Jul-10 0:55 
GeneralRe: fixed scope Pin
Chesnokov Yuriy1-Jul-10 7:56
professionalChesnokov Yuriy1-Jul-10 7:56 
GeneralRe: fixed scope Pin
Luc Pattyn1-Jul-10 9:28
sitebuilderLuc Pattyn1-Jul-10 9:28 
QuestionHow to use HashSet Pin
raju_shiva1-Jul-10 0:14
raju_shiva1-Jul-10 0:14 

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.