I am trying to build an application using VB .Net that will automatically log into ADP so that I can automatically download a time card report. I tried to show an image, but because I am new I am unable. You can view the form by going to https://portal.adp.com/public/index.htm and clicking User Login. Can someone tell me how to populate the User name and Password text boxes? I have spent a lot of time searching, but haven't been unable to find any information on this. Any help is greatly appreciated.
If you are using a WebClient to interact with the site, you can simply use the Credentials property because this is a standard HTTP-login.
Dim client As New WebClient()
client.Credentials = new NetworkCredential("username", "password")
Dim pageData As String = client.DownloadString("https://portal.adp.com/wps/employee/employee.jsp")
Here more information about the NetworkCredential class. Also you can take a look at this. If you are using a WebBrowser control, you can use this method.
You can create an Internet Explorer add-in, and use that to fill in the form and login. Here is a tutorial I found.
http://www.add-in-express.com/creating-addins-blog/2012/07/09/create-addons-ie10/
Related
How can I submit error reports to the developer (me) when coding in VB.NET?
I have made a Google Forms response form here. Is it possible to use the WebBrowser Control functions to paste a string into the TextBox in there and then click the button to submit it, all automatically?
Would it be better to use a different submission form service than this? I know that it uses complicated JavaScript to code everything. If it would be better to use a custom HTML website, how would you interact with that (I can probably figure out how to code the HTML itself)?
All help welcome!
OK, this was my solution: use System.Net.Mail and MailMessage and SMTP Credentials to send an email to the developer.
I am creating a Windows Phone App using VB.NET and what I want to do is have the user fill out a form within the app, and then when they press a send button I need to app to write these details to a text file, so I can then attach this to an email.
However the problem is I have no idea how to successfully write these details to a text file, I was wondering if anybody had an example of how it is done or just some advice that may help me to find what path I need to take in order to resolve this?
Thank you
The simplest way to send an email on Windows Phone is via the EmailComposeTask API.
Sample VB.NET code from MSDN:
Dim emailComposeTask as 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()
The downside of this API is that it doesn't allow attaching files.
So if you have the requirement to send the email with an attachment, you'll have to rely on an external service.
Here is the code for creating a text file in a MemoryStream:
Dim memoryStrm As New MemoryStream()
Dim writer As New StreamWriter(memoryStrm)
writer.WriteLine("Line 1")
writer.WriteLine("Line 2")
You could send this file to a web service that will in turn send the email.
I've heard much about you guys, I'm about to finish my application but I need to finish my login system.
I've created a notepad & uploaded it to the server with the following examples:
Username:TestUser1
Password:TestPass1
License:28/06/2013
Username:TestUser2
Password:TestPass2
License:30/06/2013
I already made a login form with a Textbox1, Textbox2 & a Button.
Textbox1 = InputUser
Textbox2 = InputPass
Button1 = Login
I want that if the button is pressed it checks the username & password matches then login with a messagebox which says: "your license is valid until: " & License.
Also, I want that every username got a password, so other users can't use other's passwords.
How can I write this code in VB.net 2010?
Thanks in advance.
Does it bother you that it takes 10 minutes to crack an authentication system like this? Not only that, but all your users and passwords will be visible to the public for anyone who knows the address (which is easy to find using just a packet analyzer).
If the answer is still no, take a look at how to use WebRequest and WebResponse to retrieve your text file: http://msdn.microsoft.com/en-us/library/456dfw4f.aspx.
PS: stackoverflow is here to solve problems in your existing code, not to write the code for you.
Someone have this for you ...
Do that with HttpWebRequest and its GetResponse method, which gives you a WebResponse on which you can call GetResponseStream to get a Stream object to pass to your StreamReader.
I have a website stored 100 users ....now i want to create a VB form with 100 buttons ....while i click button1, it will open IE then log in users1 automatic and when i click button2 , it will open IE then log in as user2 automatic. user3 until user100 the same ....click from button on vb form.
Note : i am already done to set open IE and log in as different users in each windows but now i am finding how to set auto log in with different users in the same website when i click each button in form.
i have something more about form....i will use ( 100 button click = 100 users = 100 IE window ....)
it depend on user click on button that he need to log in......because we don't know that what button/users/time will he want to click .....
I really need your help urgently...
Thank in advanced.
here is some code of Button_Click
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Using p As New Process
p.StartInfo.FileName = "C:\Program Files\Internet Explorer\iexplore.exe"
p.StartInfo.Arguments = "http://test.com"
p.Start()
End Using
This is the only way I can come up with on how to solve this.
My guess is that your login is using POST variables, it's pretty much standard.
To make this work you would have to allow the username and password to be supplied with GET. That is, sending them in the url like this:
http://test.com/login.php/asp?username=username&password=password
Since you haven't specified whether you use PHP or ASP.NET I will add info on how to get the value for both:
ASP.NET
Request.Querystring("username")
PHP
$_GET["username"];
EDIT based on comment
You are correct it is not possible to isolate separate webbrowser controls.
I would suggest you look into either WaTin to control separate IE instances, or Awsomium .NET, which i believe allows separate sessions in 1.7, though i haven't tested it.
Also be aware that since IE8 session cookies are shared across instanced by default, so you would need to run them with the -nomerge flag. WaTin supports this.
Based on the fact that you have not mentioned this in your question, i am presuming you are using IE7. If that is the case, and this application is not intended to be used on other machines, it should be possible to create a separate application with an embeded webbrowser control, then launch multiple insatances of that application from the main one, so you can add your own communication mechanism, but WaTin is probably a far better idea
OLD ANSWER:
It is very hard to work out what you want to do, but im guessing you want to create a winforms app, that lets you to choose a user account, and then open a browser and login to a website with that account.
Based on that assumption, my suggestion would be to have one button, and some way of selecting the account, say a comboBox, and a webbrowser control:
http://img198.imageshack.us/img198/888/66649645.jpg
Rather than 1 button per user account and trying to manipulate an external browser.
If this is indeed what you want to do, comment and i will edit my answer as required, and provide starting code if you need, but i cant do that without really undertanding what you need to do.
I am trying to do a file upload from gwt-ext without bringing up the dialog box. To do this, I created a FormPanel and added the appropriate fields to it. Then did a form.submit(). This doesn't seem to work. Any idea why? The code is shown below.
final FormPanel uploadForm = new FormPanel();
uploadForm.setVisible(false);
uploadForm.setFileUpload(true);
final TextField sourceFile = new TextField("File", "sourceFile");
sourceFile.setVisible(false);
sourceFile.setInputType("file");
sourceFile.setValue("/tmp/test.txt");
final TextField targetFile = new TextField("Upload As", "targetFile");
targetFile.setVisible(false);
targetFile.setValue("different.txt");
uploadForm.add(sourceFile);
uploadForm.add(targetFile);
final String url = GWT.getModuleBaseURL() + "/uploadFile";
uploadForm.getForm().submit(url, null, Connection.POST, null, false);
I tested the servlet on the server side with a simple html form and it works correctly. Only the GWT-EXT version doesn't seem to work.
I found out why the above piece of code is not working. The primary issue here is that file uploads are blocked by the browser due to security reasons if the upload form has not been rendered and/or if the form has been modified after the user clicks the submit button. If the browser did allow such things, then any file on the system can be easily uploaded without the user's knowledge.
Solution to to the above problem is to bring up the dialog box, do the upload in the event handler for the submit button and in the onActionComplete method of the form listener, do any other processing.
The whole idea of uploading without dialog box looks like a security breach to me. I can imagine an application that steals passwords file whenever opened, if only the above would be possible.