469,934 Members | 1,882 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,934 developers. It's quick & easy.

Retrieving URL from Clipboard

Hi Ppl, Could anyone help me out with retrieving URL from Clipboard
using C#??
Dec 7 '07 #1
4 2968
Hi

Maybe this helps:

System.Windows.Forms.Clipboard.SetData(System.Wind ows.Forms.DataFormats.Text, "blabla");

System.Windows.Forms.Clipboard.GetData(System.Wind ows.Forms.DataFormats.Text);
Frank

"sh**********@gmail.com" wrote:
Hi Ppl, Could anyone help me out with retrieving URL from Clipboard
using C#??
Dec 7 '07 #2
On Dec 7, 4:47 pm, Frank Uray <FrankU...@discussions.microsoft.com>
wrote:
Hi

Maybe this helps:

System.Windows.Forms.Clipboard.SetData(System.Wind ows.Forms.DataFormats.Tex-t, "blabla");

System.Windows.Forms.Clipboard.GetData(System.Wind ows.Forms.DataFormats.Tex-t);

Frank

"shirleylo...@gmail.com" wrote:
Hi Ppl, Could anyone help me out with retrieving URL from Clipboard
using C#??- Hide quoted text -

- Show quoted text -
Hi Frank,

Thanks for your suggestion. But Im looking for retrieving URLs. Like
when Im trying to copy text with url, I would like to know if the text
contains any URL or not. And if it does contain, would like to retrive
it from the copied text. I tried retrieving it in html and rtf
formats, using the following statments:

Clipboard.GetDataObject().GetDataPresent(DataForma ts.Html);
Clipboard.GetDataObject().GetDataPresent(DataForma ts.Rtf);

But Im having trouble in retrieving the URL from both formats. Any
suggestion pertaining to this would be really helpful.

-Shirley
Dec 7 '07 #3
Shirley,

I'm not sure about the clipboard part, but it seems that once you
retreived your text (string(s) of data?) from the clipboard, you might
want to use regular expressions to find URLs in that text. You could
start here:

http://www.google.com/search?q=C%23%...pression%20url

The namespace System.Text.RegularExpressions has the stuff you need to
do this in .NET. Basically you use a pattern matcher for URLs and then
iterate through the matches to find all URLs in the text you retreived
from the clipboard.

Regards, good luck,
Jeroen
Dec 7 '07 #4
On Dec 7, 7:22 pm, Jeroen <mercu...@gmail.comwrote:
Shirley,

I'm not sure about theclipboardpart, but it seems that once you
retreived your text (string(s) of data?) from theclipboard, you might
want to use regular expressions to find URLs in that text. You could
start here:

http://www.google.com/search?q=C%23%...pression%20url

The namespace System.Text.RegularExpressions has the stuff you need to
do this in .NET. Basically you use a pattern matcher for URLs and then
iterate through the matches to find all URLs in the text you retreived
from theclipboard.

Regards, good luck,
Jeroen

Thanks for your help Jeroen. I retrived the URLs in Html format
itself.

-Shirley
Dec 13 '07 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

7 posts views Thread by lgbjr | last post: by
7 posts views Thread by Newbie | last post: by
15 posts views Thread by Peter Duniho | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.