473,386 Members | 1,610 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Retrieving URL from Clipboard

Hi Ppl, Could anyone help me out with retrieving URL from Clipboard
using C#??
Dec 7 '07 #1
4 3319
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: LG | last post by:
Just have a question with regards to the clipboard, and how to read what other applications (Adobe InDesignCS) place in the clipboard. I am currently in the process of creating a booklet from a...
1
by: active | last post by:
I'm trying to retrieve Locale data from the clipboard. I'm not sure if I should use Stream to MemoryStream. I tried both and the most I could obtain was 4 bytes from the clipboard. Anyone know...
7
by: lgbjr | last post by:
Hello All, I¡¯m using a context menu associated with some pictureboxes to provide copy/paste functionality. Copying the image to the clipboard was easy. But pasting an image from the clipboard...
0
by: James Russo | last post by:
Hello, I have an application which requires an image to be retrived from the clipboard. So, I am writting a quick C# windows application to take images from a webcam and store a single frame on...
7
by: Newbie | last post by:
How do I clear the clipboard in VB.NET 2003? TIA Newbie
15
by: Peter Duniho | last post by:
I'm trying to use .NET and C# to draw a metafile copied to the clipboard by another application (Word 2003 in this case, but it shouldn't matter). I naively thought that I'd be able to use the...
1
by: Figmo | last post by:
Wow.....this is darned odd.... I have an app that integrates with other applications. It registers a global hotkey with Windows. When the hotkey executes it sends a CTRL-C to the active...
8
by: active | last post by:
Guess I'm looking for someone who likes to work difficult puzzles. I can't seem to ever retrieve a palette handle from the clipboard. Below is a simple test program that demonstrates the...
20
by: Joe Duchtel | last post by:
Hello - I have the following code to get a bitmap from the clipboard and to save it to a *.png file ... Dim lData As IDataObject = Clipboard.GetDataObject() If...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.