How to log out from a windows phone app? [closed] - c#

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I am developping a Windows Phone 8 application in C#/Xaml.
When the user launched the app, he arrives on a log page and then he enters in the "real" app. My problem is: how can the user log out?
I tried to just come back on the log page by clicking on a button but then i have trouble with the back button.
Is there a way to kill the app manually?
What are the best practices to do that?
Thanks for your help!

I would try this :
A logout button wherever you want it that redirects to a xaml page stating "do you really want to logout ?" (let's call this page Logout.xaml) and in this page, you manage to redirect the user to the homepage of your app in the "Button_Click" method of your "yes" button, in the file Logout.xaml.cs.
Then, you override the OnNavigatingFrom method of the Lougout.xaml.cs file, and in this method you kill the user session.
This way, your user wants to disconnect, clicks yes, and goes back to the homepage with his session closed.
Now, if you already wanted to do that and your question is "how to kill the session ?", it depends on how you handle your user sessions

To Terminate the application you can use :
App.Current.Terminate();
There won't be any issue when using this call, but make sure you have saved all data in your app when calling this, because this call effectively kills your app immediately - ApplicationClosing even handler won't be raised after it!

Related

Have session send and receive data after browser is closed. .NET [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 4 years ago.
Improve this question
Is there a way to have a session send and receive data in intervals even after the user has closed their browser? We have members that signup and sometimes not receive a confirmation code due to a lost request to retrieve that code from our server that generates it.
My thought is to have the session try to retrieve that code for up to 4 hours in 30 minute intervals. If not, it will send an email to the member letting them know they need to signup again.
Is this possible with sessions? We are using .NET
Due to the nature of the web being disconnected you web pages/views should should show data and post data back back on user interaction where the the most immediate functions do what they need to do quickly. For instance if a user signs up to your service they are presented with a signup page, when the commit that page their details should be saved any further actions should not be done on that page and any operation needs to assume that browser could close at any time. If a user submits the signup form you should save their details.. anything else like email notifications etc should happen after that. To enable this simply, you could use something like HangFire (https://www.hangfire.io) to monitor signups and send emails using a background process.. (you could trigger this at the time as part of your signup method or have a recurring task to check signups) the key point being that the long running task like constructing and sending an email will be done outside the page request.

How can I add an intro to a Windows Phone application? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I want to add a good welcome intro to my Windows Phone Application, like the Dropbox's one.The welcome's pages are very simple, I mean there will be just come text and image, and in the last one the user will be required to register or to login. What kind of layout/tecniques is possible to use ? This welcome intro should be display only if it is the first time, that the user opens the application, or if he hasn't registered to the service. I think the easiest way is to save same variable in the settings preferences memory, isn't it ? Thank you in advance for your suggestion !
UPDATE
What I'm looking for it is to create a welcome pages which describe to the user what the application does. The layout I'm looking for it is very similar to the Dropbox's one, which has some points at the end of the pages.
Quite a broad question, there are many ways on how to approach this. I would do it like this
Create a IsLoggedIn method on my data service
In App.xaml.cs, check if the user is logged in, if yes, launch with the main page, if not launch with the intro page
In the intro page, I would use a FlipView. I would add one fake item at the end of the FlipView and redirect to the main page if the user flips to it.

How to prepare a Windows pc to run a Touch screen Kiosk Shopping Mall App [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I want to lock a Windows machine. So the user won't be able to exit the full screen intensionally or by mistake. Also if the application crash, just will display an error page.
Not the default Windows grey popup window with the "OK" button.
What Im thinking is having a process checking the status of my app. And If the app fails sends a email to the administrator and restart 3 times then if no success shutdown.
Go with WPF.
Set the Window:
BorderStyle=None
Topmost=True
For the Application error catching:
Create an DispatcherUnhandledException event on App, that will show another fullscreen window to handle the case of the app failure.
To avoid the user exiting it, you can monitor user KeyDown and set event.Handled=true

How to click OK on messagebox? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I'm trying to develop a webbrowser application.
When my app clicks on a link, a messagebox pops up with OK and Cancel options. I have to click OK to continue. I tried every possible way to my knowledge with no success.
SendKeys did not work.
I believe if somehow I can switch to the message window, sendkeys might work.
How can I achieve this?
Message Box is a UI element, there isn't an easy way to automate interacting with the message box. There is also the issue of using a Windows message box vs. using a JavaScript confirmation dialog.
Message Box is part of the server execution. It just so happen that in development your server and client are the same machine. So the Windows message box appears on the server (which is your local box.) if you were to deploy this to an actual server the message box would appear on the server, not the user's local machine. That' simply doesn't work for web development.
Now, you could use a JavaScript confirmation dialog. To do this you need to write/render JavaScript to the browser that will open a confirmation dialog when the body of the html is loaded. Not a good idea, but possible. Typically you want to avoid popups and dialogs when a page loads.
So your best option is to either re-design the UI so a message box is not displayed or use a different route to execute the process and bypass the UI altogether.
Assuming you're using the WebBrowser control embedded in a WIndows form named Frm, you could try calling the Activate() and Focus() methods before using SendKeys...
Frm.Activate()
Frm.Focus()
SendKeys.SendWait("{Enter}")
That has worked for me.

Winform app with loaded DB connection [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I have a question regarding problem i am solving. I am editing an old Winform app; currently the only part I need does not take input from the user(automated program). However the form contains database connection settings that program uses. Currently the program needs the user to press a button to start the process (code is associated with the button). Do i need to convert whole app to Console App or is there an easier way to automate this process without messing with the database connection settings.
Right now, you have a WinForm that runs code on a button press. You need to turn this into a "headless" or automatic process. Here is what I think based on your description would be the best things to do:
Remove the button, and have the code that was being ran by the button be called by a more "automatic" process, such as "Form_Load" or a timer.
Take the code and move it into a console app. As long as you don't ask for user input within the logic, it will run and close itself when it's done.
However, this is just some broad and generic suggestions. You need to look at your code and decide for yourself what to do.

Categories