C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Communities   Interview   Jobs   Projects   Offshore Development    
Silverlight Tutorials | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Revenue Sharing |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...

New Feature: Community Sites: Create your own .NET community website and start earning from Google AdSense ! It's Free !




Get URL From IE


Posted Date: 07 Sep 2008      Total Responses: 1

Posted By: mansi sharma       Member Level: Bronze     Points: 1



Imports mshtml
Imports SHDocVw
Imports Microsoft.Win32
Imports System.Runtime.InteropServices


Public Class Form1

Public Const BaseKey As String = "SOFTWARE\Microsoft\Internet Explorer\Extensions"
Public Const SubKey As String = "{10954C80-4F0F-11d3-B17C-00C0DFE39736}"


Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim reg As RegistryKey = Registry.LocalMachine
Dim sk As RegistryKey = reg.OpenSubKey(BaseKey, True)
sk = sk.CreateSubKey(SubKey)

sk.SetValue("ButtonText", "Button")
sk.SetValue("CLSID", "{1FBA04EE-3024-11D2-8F1F-0000F87ABD16}")
sk.SetValue("Default Visible", "Yes")
sk.SetValue("Exec", "D:\Working\IEToolbarButtons\IEToolbarButtons\bin\Debug\IEToolbarButtons.exe")
sk.SetValue("HotIcon", "C:\Windows\System\setup.ico")
sk.SetValue("Icon", "C:\Windows\System\setup.ico")
sk.Close()
reg.Close()

End Sub

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim browser As SHDocVw.InternetExplorer
Dim myLocalLink As String
Dim myDoc As mshtml.IHTMLDocument2
Dim shellWindows As SHDocVw.ShellWindows = New SHDocVw.ShellWindows()
Dim filename As String

For Each ie As SHDocVw.InternetExplorer In shellWindows
filename = System.IO.Path.GetFileNameWithoutExtension(ie.FullName).ToLower()

If filename = "iexplore" Then
browser = ie
myDoc = browser.Document
myLocalLink = myDoc.url
MessageBox.Show(myLocalLink)
End If
Next

End

End Sub
End Class


mshtml-->Add reference microsoft.mshtml
SHDocVw--> Go to Add Reference-->Go to Broese tab-->C:--Windows--System32--shdocvw.dll

sk.SetValue("HotIcon", "C:\Windows\System\setup.ico")
C:\Windows\System\setup.ico--In place of it,Add any icon that has extension .ico,cz its not a valid ico file.

OUTPUT--
Open Two Sites are open google.com, daniweb.com.
Now open site yahoo.com. Click on button that is created with icon u added,when u clik on it.it shows as messageBox,
Fisrt google.com,daniweb.com & then yahoo.com

Cz all these sites are open.

I want that whether two sites are open google.com,daniweb.com,O/p Should be only yahoo.com








Responses

Author: Avadhesh Kumar Tiwari    08 Sep 2008Member Level: SilverRating:     Points: 2

try Request.rawURl, Hope it will help you


string str = Request.RawUrl;



Post Reply
You must Sign In to post a response.
Next : Difference
Previous : C#+ date comparision mistake+Urgent
Return to Discussion Forum
Post New Message
Category: .NET

Related Messages



dotNet Slackers   BizTalk Adaptors    Web Design


Contact Us    Privacy Policy    Terms Of Use