Check clipboard for a URL
-
I want to know how can I check if the clipboard has a URL or not? basically I have a txtURL textbox on my form and I want if they user went to any browser or word editor to copy a URL from there then came back o the same form it should display a MessageBox saying dio you want to copy the URL in the textbox?
-
I want to know how can I check if the clipboard has a URL or not? basically I have a txtURL textbox on my form and I want if they user went to any browser or word editor to copy a URL from there then came back o the same form it should display a MessageBox saying dio you want to copy the URL in the textbox?
Yeah, just check if the text in the clipboard is a valid URL. I don't believe there is a specific format for URL's when copied to the clipboard (i.e., they will just be copied as text). Actually, the way the clipboard works is that items can be copied to the clipboard in their various formats. So, the URL might exist as both text and as, say, HTML in the clipboard. If you really want to know, give it a try... handle some event that inspects the clipboard and see what formats are in it, then see what data is contained in each format.
-
I want to know how can I check if the clipboard has a URL or not? basically I have a txtURL textbox on my form and I want if they user went to any browser or word editor to copy a URL from there then came back o the same form it should display a MessageBox saying dio you want to copy the URL in the textbox?
Get the text from the
Clipboard
using theGetText
method then match it against a URL regular expression.Eslam Afifi