|
-
Sep 29th, 2012, 12:01 PM
#1
Thread Starter
Member
Check if website is open
Ok, so as you probably haven't understood from the title... I am wondering if there is any way i can make my VB.net project check if a website is open in
google chrome and/or IE (intenet explorer). 
Further/more detailed explanation:
My school uses a site called It's learning to see homework, upload it, and ask teachers questions. But we were given very difficult passwords and usernames (wich we can not change for some reason). So I have made a program that auto-types the log-on info, and hits the logon button. HOWEVER! We use google chrome and internett explorer as webbrowsers, and I do not know how i can by code check if a website is opened in those webbrowsers.
I guess i could make my program WITH a web browser, but i would never be able to match the quality that chrome can provide.
So how can i detect if a site is opened in chrome, then fill in the info, and hit the button? (if it is impossible, please just say so... (however, i will think it is possible. After all, trojans from viruses can do it... :P )
I apologize for my bad english, writing mistakes, and weird writing in general. I have been up for so long trying to figure this out! Thanks for all replies
-
Sep 29th, 2012, 12:13 PM
#2
Thread Starter
Member
Re: Check if website is open
Just realized i could make a chrome extension, but this is coded in Java, a coding language i do not know... AND, if i knew it, i still had to find a way that the user could enter the username and password when installing the extension, otherwise it would only be able to fill in the one username and password that i entered... Please help me out here!
(If it matters, here is the log on site: https://idp.feide.no/simplesaml/modu...2Fdefault.aspx )
Last edited by TeachMeHow; Sep 29th, 2012 at 12:18 PM.
-
Sep 29th, 2012, 12:55 PM
#3
Re: Check if website is open
You could check the LocationUrl or LocationName for internet explorer and then use the document to write information
-
Sep 29th, 2012, 02:51 PM
#4
Thread Starter
Member
Re: Check if website is open
 Originally Posted by Max187Boucher
You could check the LocationUrl or LocationName for internet explorer and then use the document to write information
... I am a noob :P ... Really... i AM a NOOOB! I need more info please Explain in details Thanks
-
Sep 29th, 2012, 03:08 PM
#5
Re: Check if website is open
I could make you an example of code but i do not have .net installed only vb6 but i can make you a code example if you'd like it will use internet explorer. Give me a couple hours i am not at home just on my iphone at the moment
-
Sep 29th, 2012, 03:53 PM
#6
Thread Starter
Member
Re: Check if website is open
 Originally Posted by Max187Boucher
I could make you an example of code but i do not have .net installed only vb6 but i can make you a code example if you'd like it will use internet explorer. Give me a couple hours i am not at home just on my iphone at the moment
Yeah! thanks! would appresiate that But is it possible to make it for chrome instead? Most of my classmates (including me) uses chorme, so i preffer that as an option...
-
Sep 29th, 2012, 05:13 PM
#7
Re: Check if website is open
I dont know about chrome it is a whole different program i will have a look but as of right now i do not know anything about chrome but do you still want the internet explorer lime i said i will have a look at chrome but dont expect anything
-
Sep 29th, 2012, 08:33 PM
#8
Re: Check if website is open
here is some code you can play with... hopefully it is 100% compatible with .net i googled a couple functions and it looks like it should work
ok so to check if website is opened try this
Code:
Dim objShell As Object, objIE As Object, objShellWindows As Object
Dim iCount As Integer
Set objShell = CreateObject("Shell.Application")
Set objShellWindows = objShell.Windows
On Error Resume Next
For i = 0 To objShellWindows.Count - 1
If InStr(1, objIE.locationurl, "https://idp.feide.no") Then
MsgBox "Found idp.feide.no Website!"
End If
Next
and for manipulation of document... of Internet Explorer (sorry no luck with chrome it uses WebKit and completely different i guess)
Code:
Dim IE As Object
Set IE = CreateObject("InternetExplorer.Application")
With IE
.Silent = True
.Visible = True
.Navigate "https://idp.feide.no/simplesaml/module.php/feide/login.php?org=alstahaug.kommune.no&asLen=253&AuthState=_0436c342a257156857910430fffbb853228cef6218%3Ahttps%3A%2F%2Fidp.feide.no%2Fsimplesaml%2Fsaml2%2Fidp%2FSSOService.php%3Fspentityid%3Durn%253Amace%253Afeide.no%253Aservices%253Acom.itslearning%26cookieTime%3D1348966536%26RelayState%3Dhttps%253A%252F%252Fwww.itslearning.com%252Felogin%252Fdefault.aspx&submit=Continue+%C2%BB"
End With
Do While Not IE.locationurl = "https://idp.feide.no/simplesaml/module.php/feide/login.php?org=alstahaug.kommune.no&asLen=253&AuthState=_0436c342a257156857910430fffbb853228cef6218%3Ahttps%3A%2F%2Fidp.feide.no%2Fsimplesaml%2Fsaml2%2Fidp%2FSSOService.php%3Fspentityid%3Durn%253Amace%253Afeide.no%253Aservices%253Acom.itslearning%26cookieTime%3D1348966536%26RelayState%3Dhttps%253A%252F%252Fwww.itslearning.com%252Felogin%252Fdefault.aspx&submit=Continue+%C2%BB"
DoEvents
Loop
Do While IE.readystate <> 4
DoEvents
Loop
'Start Using Document
IE.document.Forms.f.username.Value = "Example For You"
IE.document.Forms.f.password.Value = "MyPasswordHere"
'This (below) is the Login Button (to click on the button)... remove the ' to allow click on the button
'IE.document.Forms.f.childNodes.Item(1).childNodes.Item(5).childNodes.Item(10).Click
so add one of those to a button click or form load try and play around with that i hope it will work for you it does for me... let me know if you need more help
-
Sep 30th, 2012, 07:23 AM
#9
Thread Starter
Member
Re: Check if website is open
Thanks! I will try it But i'm not home at the moment, and i am busy. I'll try it tomorow probably
-
Sep 30th, 2012, 08:14 AM
#10
Re: Check if website is open
Yeah, I wouldn't bother. Definitely not .Net compatible!
Is there any reason for not simply using Process.Start("https://idp.feide.no/") which will open the page in the default browser thereby ensuring that it is both open and the current tab?
As the 6-dimensional mathematics professor said to the brain surgeon, "It ain't Rocket Science!"
Reviews: "dunfiddlin likes his DataTables" - jmcilhinney
Please be aware that whilst I will read private messages (one day!) I am unlikely to reply to anything that does not contain offers of cash, fame or marriage!
-
Sep 30th, 2012, 12:34 PM
#11
Re: Check if website is open
Well it might not be 100% compatible but im sure you might have to change maybe how the document is used?
-
Sep 30th, 2012, 12:36 PM
#12
Re: Check if website is open
Anyway i will install visual studio the newest one.. But not right now in a dat or two i'll be able to do further testing then
-
Oct 1st, 2012, 08:12 AM
#13
Thread Starter
Member
Re: Check if website is open
 Originally Posted by Max187Boucher
Anyway i will install visual studio the newest one.. But not right now in a dat or two i'll be able to do further testing then
I would apressiate that! I'm on vacation at the moment.. and didnt bring my pc. (I'm currently using a pc at the hotel). Will be back before the end of the week. No day decided.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|