I am making a game for my windows phone, using Visual Studio 2012 for Windows Phone and it went good from there, I wrote a few classes, and added assets but I encountered a problem.
I wanted to make a bug request / idea method, but no-where could I find where to email with XNA. I searched on Google but it came up with stuff like "How to use XNA game studio" and at the bottom it said stuff like "email us" so I never found it out. Basicley I couldn't find it. Can anyone help me out?
You can send an email out using the EmailComposeTask class in WP8. But it not totally automatic, the user has to select the account to send the email with then the Email display pops up then they have to click on send button. You can try it like this:
How to use the email compose task for Windows Phone 8
using Microsoft.Phone.Tasks;
// do this when the page has load completely (not in the constructor)
EmailComposeTask emailComposeTask = new EmailComposeTask();
emailComposeTask.Subject = "message subject";
emailComposeTask.Body = "message body";
emailComposeTask.To = "recipient#example.com";
emailComposeTask.Cc = "cc#example.com";
emailComposeTask.Bcc = "bcc#example.com";
emailComposeTask.Show();
However, I don't think this is what you want. What I would do instead because it's difficult to do the email thing silently is create a webpage, that you can POST to. You then can just open a WebClient and POST the data that you need to that website. Then on the website's back end, just decode the POST[DATA] into a database.
Hope this helps you, good luck.
As mentioned in the other answer, you may want to consider just opening a web page with a form for them to fill out, rather than writing emails within your app.
If so, here is the code to open a webpage on Windows Phone from an XNA game (using http://www.google.com/ as an example.:
WebBrowserTask browser = new WebBrowserTask();
browser.Uri = new Uri("http://www.google.com/", UriKind.Absolute);
browser.Show();
Related
I am trying to write UI Automation for a Portal but while Authentication Chrome after entering User name a Pop up comes which can not be handled by selenium c#
I have tried using
https://username:password{siteurl}.com
But it didn't work. Also Auto IT nuget is not working. Any suggestions will be really helpful
PFB the screenshot for the same.
You can't try using a "robot" keyboard which just types in the keyboard. There is no need for the element to be inside the HTML page, as long as you know the prompt is focused:
Install the NuGet InputSimulator:
InputSimulator sim = new InputSimulator();
sim.Keyboard.TextEntry("User123");
sim.Keyboard.KeyPress(VirtualKeyCode.TAB);
sim.Keyboard.TextEntry("Password123");
sim.Keyboard.KeyPress(VirtualKeyCode.RETURN);
This way you just "hit" the keyboard. You code works regardless of the webpage.
If the popping prompt is not part of the HTML page, but a Windows alert, you can try using the keyboard:
new Actions(driver).SendKeys("User_Name").Perform();
new Actions(driver).SendKeys(Keys.Tab).Perform();
new Actions(driver).SendKeys("Password_here").Perform();
new Actions(driver).SendKeys(Keys.Tab).Perform();
new Actions(driver).SendKeys(Keys.Enter).Perform();
Basically you just type the user_name and password and hit the Enter key using Selenium.
I wanted to do a program where I can add a few accounts, to login with one click.
I tried to add a dll as reference but that didn't work.
The problem is, I dont know how I use the sdk (folder) that i downloaded, in my C# WinForm project.
Thanks for help
Well the docs at SteamKit2 are pretty straight forward. I coded a bot for myself and dont know if it works on the latest version of steam client but yeah i have a clear idea about what to do.
If you have a look here you create a new steamClient and subscribe to events.
_steamClient = new SteamClient();
and then connect to the client.
_manager = new CallbackManager(_steamClient);
_steamUser = _steamClient.GetHandler<SteamUser>();
_steamFriends = _steamClient.GetHandler<SteamFriends>();
_manager.Subscribe<SteamClient.ConnectedCallback>(OnConnected);
_manager.Subscribe<SteamClient.DisconnectedCallback>(OnDisconnected);
_manager.Subscribe<SteamUser.LoggedOnCallback>(OnLoggedOn);
_manager.Subscribe<SteamUser.LoggedOffCallback>(OnLoggedOff);
_manager.Subscribe<SteamUser.AccountInfoCallback>(OnAccountInfo);
_manager.Subscribe<SteamUser.UpdateMachineAuthCallback>(OnMachineAuth);
_manager.Subscribe<SteamFriends.FriendMsgCallback>(OnChatMessage);
_manager.Subscribe<SteamFriends.FriendsListCallback>(OnFriendList);
Console.WriteLine("Connecting to steam in 3s");
_steamClient.Connect();
I have created several windows phone apps and I would like to link to my publisher's page to show all of the apps that I publish. Note that I am developing my app for Windows Phone 7.x and up using C# and XAML.
UPDATE
What I would like to do is show the following publisher page: From within Windows Phone, navigate to the Windows Phone store, then select any app, then select the "more from <Publisher>" link. This displays a nice mobile view of all of that publisher's apps. But I can't figure out how to bring up that publisher page directly from within my app. Any help would be appreciated!
Option 1) Link directly to the URL for my publishers page (using a WebBrowserTask)
Issue) All links to the store seem to require the en-US language embedded in the URL. I'm concerned about what will happen to users in other countries/languages.
Example: http:/www.windowsphone.com/en-US/store/publishers?publisherId=Microsoft%2BCorporation
Is there a language independent way to link to a publisher in the store?
Option 2) Use the MarketplaceDetailTask to link to the publisher
Issue) From what I've seen, this can only be used to link to an app. I tried using my publisher GUID and got: Marketplace Error - We're sorry, but we can't complete your request right now.
MarketplaceDetailTask marketplaceDetailTask = new MarketplaceDetailTask();
marketplaceDetailTask.ContentType = MarketplaceContentType.Applications;
marketplaceDetailTask.ContentIdentifier = <My Publisher GUID>;
marketplaceDetailTask.Show();
Option 3) Use the MarketplaceSearchTask to link to the publisher
Issue) This allows searching the store with any string. The problem is, when I put my publisher name in the search string, other apps are shown in addition to mine. My publisher name includes a common word and any app with that word shows up.
MarketplaceSearchTask searchTask = new MarketplaceSearchTask();
searchTask.ContentType = MarketplaceContentType.Applications;
searchTask.SearchTerms = "<My Publisher Name>";
searchTask.Show();
Any thoughts or suggestions would be appreciated!
Thanks.
As you're targeting WP7+, unfortunately using the zune:search URI only works on WP8 as it relies on URI Schemes, which was not backported to WP7. Based on these two posts, I tried the following on your behalf:
zune://search/?publisher=Henry%20Chong;
And a bunch of other things, but it seems that only zune://navigate is available on Windows Phone 7 and that only allows you to load a specific app. (Perhaps someone who feels like opening reflector or on the Phone teams could comment here...)
Two other things I've come across that you can look into:
1) There used to be an undocumented Zune api that you could query the marketplace against; it looks like this has been replaced by the Marketplace Edge Service, which you could try and dig around for:
http://social.msdn.microsoft.com/forums/windowsapps/en-US/f5294fcb-f4b3-4b19-9bda-f49c6a38b327/marketplace-edge-service-query
2) You could add a specific unique keyword to all your apps and use the MarketplaceSearchTask, as suggested here by Matt.
Personally, I'd go with #2 because:
you never know when the Marketplace Edge Service will change
1 is not technically supported by Microsoft
you won't have to replicate the page you're trying to display
Of course, there's also nothing stopping you from creating your own "Apps by X" page for your app and maintain it yourself manually.
Best of luck!
I'm trying to use Selenium WebDriver to automatically login in to a site with a user-name and password. I've done my research and I don't believe this feature is supported by WebDriver, so I need to find another way. The site I'm trying to automate logging into is located here.
When prompted to login a popup window comes up that doesn't seem to be part of the browser. I'm using Firefox and Chrome. It seems Windows API may be required? I already tried passing the credentials in the URL but that didn't work. Also tried sendkeys, but received a Windows exception that the application was not accepting Windows messages. I also tried switching the current handle using driver.windowhandles but the popup doesn't seem to be a new handle.
Does anybody have any ideas? I'm kinda stuck. The preliminary code to get to the popup window is:
IWebDriver driver = new FirefoxDriver();
driver.Navigate().GoToUrl("http://www.portal.adp.com");
string currentWindow = driver.CurrentWindowHandle;
IWebElement userLogin = driver.FindElement(By.Id("employee"));
userLogin.Click();
The popup you are seeing is prompted by web server and is a authentication prompt. Selenium doesn't support this operation.
One of the way to handle this limitation is to pass user and password in the url like like below:
http://user:password#example.com
More info available here : http://aleetesting.blogspot.in/2011/10/selenium-webdriver-tips.html
I wanted my answer out there because I think I've solved it. This answer does not require passing the credentials through the URL (for those of you that are unable to like me). It also does not require any custom Firefox Profiles or extensions to be installed or included with the solution or installed onto the browser eliminating cross-machine compatibility issues.
The issue with me was that the authentication could not be completed via passing the credentials through the URL because the login was behind a proxy.
So, I turned to windows automation toolkits and found AutoIT. Using AutoIT and Selenium, you can login automatically by sending the username and password to the windows dialog that appears. Here's how (note the steps below are for c#:
1 - Download AutoIT from http://www.autoitscript.com/site/autoit/downloads/
2 - Add the autoit .dll to your project references.
Right click on references, select Add Reference. Next click the browse button and browse to the dll location (most default installations it will be c:\Program Files (x86)\AutoIt3\AutoItX\AutoItX3.dll), and add to project.
3 - use AutoIT and Selenium like this (assuming your web driver is already initialized):
//Initialize AutoIT
var AutoIT = new AutoItX3();
//Set Selenium page load timeout to 2 seconds so it doesn't wait forever
Driver.Manage().Timeouts().SetPageLoadTimeout(TimeSpan.FromSeconds(2));
//Ingore the error
try
{
Driver.Url = url;
}
catch
{
return;
}
//Wait for the authentication window to appear, then send username and password
AutoIT.WinWait("Authentication Required");
AutoIT.WinActivate("Authentication Required");
AutoIT.Send("username");
AutoIT.Send("{TAB}");
AutoIt.Send("password");
AutoIT.Send("{ENTER}");
//Return Selenium page timeout to infinity again
Driver.Manage().Timeouts().SetPageLoadTimeout(TimeSpan.FromSeconds(-1));
Anyway, that's it, and it works like a charm :)
Also note that there are some special characters that need to be escaped in AutoIT using the sequence "{x}". For example, if your password is "!tRocks", you'd need to pass it into AutoIT as "{!}tRocks".
Happy automating.
FirefoxProfile profile = new FirefoxProfile();
profile.SetPreference("network.http.phishy-userpass-length", 255);
profile.SetPreference("network.automatic-ntlm-auth.trusted-uris", hostname);
Driver = new FirefoxDriver(profile);
hostname is your URL (example.com) then try to
Driver.Navigate().GoToUrl(http://user:password#example.com);
I just got done working on a prototype project that is supposed to handle exactly this kind of situation.
It utilizes BrowserMob, a popular open source proxy, to perform the authentication.
SeleniumBasicAuthWrapper Hope it helps! It is still a work in progress, but hopefully we'll get any kinks or defects ironed out in the near future.
I have mad an application for windows mobile which can do different mobile functions with the numbers the application has.
Anyway. I want to start the Text message application and send a phonenumber as an argument.
I have only found this:
SmsMessage sms = new SmsMessage();
sms.Body = "This is a message";
sms.To.Add(new Recipient(sNumber));
sms.Send();
But i want to use the text messaging application in the mobile device.
Any tip?
thanks in advance
As a start, have you looked to see if this discussion is relevant to what you want to do? One thing it mentions is using CE MAPI and COM interop. There's also the Mobile In The Hand library.
There are other links in that discussion too.
Take a look at the MessagingApplication class, in particular its DisplayComposeForm static method. You should be able to use a code snippet such as the following to get the built in messaging application to appear.
SmsMessage sms = new SmsMessage();
sms.Body = "This is a message";
sms.To.Add(new Recipient(sNumber));
MessagingApplication.DisplayComposeForm(sms);
I also have a blog post available with a sample application that in part demonstrates using this API - http://www.christec.co.nz/blog/archives/495.