English 中文(简体)
c# using SHDocVw.InternetExplorer. How can I find the URL of the last link clicked? Or the most recent get request URL?
原标题:

I am accessing the SHDocVw.InternetExplorer from the SHDocVw.ShellWindowsClass(). I can see the page that the browser instance is currently on (the LocationURL property), but what I really need is the last get request that was done for the browser. My specific need is that my application was just launched to handle a file that was downloaded to the user s system via a link on the current web page. I need to know the URL of that file. LocationURL gives me the URL of the page that the link is on, but I need the URL of the file/link.

EDIT: The web application I ve been trying to interface with is SharePoint. I wasn t able to find a way to extract the URL of the last clicked link (file downloaded) from Internet Explorer, so now I m hoping to find a way to get that information from either SharePoint itself, or piggyback on the Name ActiveX control that SharePoint uses to manage the download of MS Office documents. Any SharePoint/Name ActiveX experts out there?

问题回答

Since you can t get the url from Internet Explorer s history using IUrlHistoryStg::EnumUrls http://msdn.microsoft.com/en-us/library/aa767720%28VS.85%29.aspx

try making sure the file association is setup one the box and that your app can take a file path from the command line to start up.

I added these keys to my registry

[HKEY_CLASSES_ROOT.sdr]
@="sdrfile"

[HKEY_CLASSES_ROOTsdrfileshellopencommand]
@=""D:\Shenanigans\MyGreatApp.exe" "%1""

on a Win7 box and IE/Sharepoint figured it out. If you poke around HKCR you ll see that it can get more complicated to setup file associations, but see if this works.





相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

NSArray s, Primitive types and Boxing Oh My!

I m pretty new to the Objective-C world and I have a long history with .net/C# so naturally I m inclined to use my C# wits. Now here s the question: I feel really inclined to create some type of ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

How to Use Ghostscript DLL to convert PDF to PDF/A

How to user GhostScript DLL to convert PDF to PDF/A. I know I kind of have to call the exported function of gsdll32.dll whose name is gsapi_init_with_args, but how do i pass the right arguments? BTW, ...

Linqy no matchy

Maybe it s something I m doing wrong. I m just learning Linq because I m bored. And so far so good. I made a little program and it basically just outputs all matches (foreach) into a label control. ...

热门标签