0

I am working with windows ce for an application that needs to be authenticated before use. I don't want the end user to have to enter a username and password which is static everytime the device is turned on. Is there any way to do something like that? I was able to acheive it in a windows form application but i haven't seen anything on Stack or in the MSDN that will help me do that. My code for the forms app is below but it wont work in the Compact Framework.

//string doc = webBrowser1.DocumentText;
        //HtmlElement userValue = doc.GetElementById("username");
        //userValue.SetAttribute("value", "devacc");
        //HtmlElement passValue = doc.GetElementById("password");
        //passValue.SetAttribute("value", "zzq15354");
        //HtmlElement subButton = doc.GetElementById("submit");
        //subButton.InvokeMember("click");
  • 1
    Instead of trying to patch the HTML and simulating a user-click, maybe you could directly invoke the web service and send the "devacc"/"zzq15354" credentials using an `HttpWebRequest`. Something like [this](http://stackoverflow.com/questions/4529547/webrequest-with-post-parameters-in-net-compact-framework) ? – David LaPorte Jan 02 '14 at 21:15

1 Answers1

0

I believe your going to need to verify user/device another way. I would probably save the devices MEID(Dec) # (which is unique) to your user data then allow access if signed in ON that specific hardware.. Here is a thread on how to find that number Find Serial Number

Community
  • 1
  • 1
JayD
  • 6,173
  • 4
  • 20
  • 24
  • this is just to access an api so i dont have the access to let it through without the username and password. It would be fairly simple if i could find the html element and just input it there. – Arachnid Hivemind Jan 02 '14 at 20:04
  • You could still store the MEID and associate it with a user and pass then write a conditional if userid & pass is associated ... proceed.. You could also store the user and pass on device and call it from there http://stackoverflow.com/questions/1925486/android-storing-username-and-password – JayD Jan 02 '14 at 20:06
  • this is the type of authorization that needs to be done. Im not sure if i can use the MEID for this since im not passing the values as a parameter or field. http://imgur.com/m7uC1rq – Arachnid Hivemind Jan 02 '14 at 20:22
  • You need to re word your question more clearly so i can understand exactly what your wanting to accomplish ... After viewing the picture you have me a little confused in the direction you want – JayD Jan 02 '14 at 20:28
  • I want to be able to fill in the username and password on start up so nothing has to be manually entered. – Arachnid Hivemind Jan 02 '14 at 20:41
  • the only way you'll be able to do that is based off of previously storing your user name/password and then keying off of a unique identifier of the device to ensure its actually that user... The only way i know of to do that is to store the user/pass, check the device MEID (or other unique identifier), and if they match ... post – JayD Jan 02 '14 at 20:44