473,396 Members | 1,972 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,396 software developers and data experts.

How to get the contnet of clipboard

ad
Hi,
How can we get the content of clipboard with program?


Nov 23 '05 #1
16 1906
ad wrote:
Hi,
How can we get the content of clipboard with program?


client-side (on the user's PC): you can't. you don't have access to it...

server-side:
http://msdn.microsoft.com/library/de...classtopic.asp

--
craig
Microsoft MVP - ASP/ASP.NET
Nov 23 '05 #2
MSIE supports obtaining the user's clipboard.
Once obtained it is easy to transmit to the server.
"Craig Deelsnyder" <cdeelsny@NO_SPAM_4_MEyahoo.com> schreef in bericht
news:uH**************@TK2MSFTNGP15.phx.gbl...
ad wrote:
Hi,
How can we get the content of clipboard with program?


client-side (on the user's PC): you can't. you don't have access to it...

server-side:
http://msdn.microsoft.com/library/de...classtopic.asp

--
craig
Microsoft MVP - ASP/ASP.NET

Nov 23 '05 #3
Using Javascript Command

document.execCommand('paste');

more details here ..

http://msdn.microsoft.com/library/de...xeccommand.asp

I think this works only in IE and Browser settings can block the paste
operation..

"ad" wrote:
Hi,
How can we get the content of clipboard with program?


Nov 23 '05 #4
Edwin Knoppert wrote:
MSIE supports obtaining the user's clipboard.
Once obtained it is easy to transmit to the server.
"Craig Deelsnyder" <cdeelsny@NO_SPAM_4_MEyahoo.com> schreef in bericht
news:uH**************@TK2MSFTNGP15.phx.gbl...
ad wrote:
Hi,
How can we get the content of clipboard with program?

client-side (on the user's PC): you can't. you don't have access to it...

server-side:
http://msdn.microsoft.com/library/de...classtopic.asp

--
craig
Microsoft MVP - ASP/ASP.NET



Yikes, you're right! Tells you how often I build IE-specific
applications, not to say other browsers might not have given this
capability. Me as a user? I don't like it....do you know if you get
cross-domain access (read stuff I copied while browsing a different domain)?

Anyway, I dug this up after Edwin's reply...

http://msdn.microsoft.com/workshop/a...pboardData.asp

looks like it only works for text that is copy/paste using the menus in
IE (not using shortcut keys)? Just figuring this out for myself as well...

--
craig
Microsoft MVP - ASP/ASP.NET
Nov 23 '05 #5
re:
MSIE supports obtaining the user's clipboard.
Once obtained it is easy to transmit to the server.
Please post sample code.

Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
ASPNETFAQ.COM : http://www.aspnetfaq.com/
Foros de ASP.NET en Español : http://asp.net.do/foros/
======================================
"Edwin Knoppert" <in**@pbsoft.speedlinq.nl> wrote in message
news:dm**********@azure.qinip.net... MSIE supports obtaining the user's clipboard.
Once obtained it is easy to transmit to the server.
"Craig Deelsnyder" <cdeelsny@NO_SPAM_4_MEyahoo.com> schreef in bericht
news:uH**************@TK2MSFTNGP15.phx.gbl...
ad wrote:
Hi,
How can we get the content of clipboard with program?


client-side (on the user's PC): you can't. you don't have access to it...

server-side:
http://msdn.microsoft.com/library/de...classtopic.asp

--
craig
Microsoft MVP - ASP/ASP.NET


Nov 23 '05 #6
I did see this work on a live website, not mine.
It did work.
It was there to proof that the CB could be read.

"Juan T. Llibre" <no***********@nowhere.com> schreef in bericht
news:ug**************@TK2MSFTNGP12.phx.gbl...
re:
MSIE supports obtaining the user's clipboard.
Once obtained it is easy to transmit to the server.


Please post sample code.

Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
ASPNETFAQ.COM : http://www.aspnetfaq.com/
Foros de ASP.NET en Español : http://asp.net.do/foros/
======================================
"Edwin Knoppert" <in**@pbsoft.speedlinq.nl> wrote in message
news:dm**********@azure.qinip.net...
MSIE supports obtaining the user's clipboard.
Once obtained it is easy to transmit to the server.
"Craig Deelsnyder" <cdeelsny@NO_SPAM_4_MEyahoo.com> schreef in bericht
news:uH**************@TK2MSFTNGP15.phx.gbl...
ad wrote:
Hi,
How can we get the content of clipboard with program?

client-side (on the user's PC): you can't. you don't have access to
it...

server-side:
http://msdn.microsoft.com/library/de...classtopic.asp

--
craig
Microsoft MVP - ASP/ASP.NET



Nov 23 '05 #7
I would have liked to see sample code for doing that,
in ASP.NET, if it's that easy.

Maybe you didn't take into account that the clipboard class
is in the System.Windows.Forms namespace ( which, as
Craig told you, cannot be accessed by ASP.NET server-side ) ?

Even if it were to be accessed, it would be the *server's* clipboard
that's accessed, if this thing is running server-side, wouldn't it ?

So, that leaves, as the only alternative, to write a client-side program
which captures client data, in sync with the current ASP.NET context,
have the user install it and run it so that the correct data is captured client-side,
and figure out a way to insert the clipboard's contents to the server, in context
with the current request.

That last part doesn't seem too complicated, although it's certainly not "easy".

The first part certainly is complicated, and that's why I wondered why you
described the procedure as "once obtained it is easy to transmit to the server".

That "once obtained" is what you overlooked.

Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
ASPNETFAQ.COM : http://www.aspnetfaq.com/
Foros de ASP.NET en Español : http://asp.net.do/foros/
======================================
"Edwin Knoppert" <in**@pbsoft.speedlinq.nl> wrote in message
news:dm**********@azure.qinip.net...
I did see this work on a live website, not mine.
It did work.
It was there to proof that the CB could be read. "Juan T. Llibre" <no***********@nowhere.com> schreef in bericht
news:ug**************@TK2MSFTNGP12.phx.gbl...
re:
MSIE supports obtaining the user's clipboard.
Once obtained it is easy to transmit to the server.


Please post sample code.

Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
ASPNETFAQ.COM : http://www.aspnetfaq.com/
Foros de ASP.NET en Español : http://asp.net.do/foros/
======================================
"Edwin Knoppert" <in**@pbsoft.speedlinq.nl> wrote in message
news:dm**********@azure.qinip.net...
MSIE supports obtaining the user's clipboard.
Once obtained it is easy to transmit to the server.
"Craig Deelsnyder" <cdeelsny@NO_SPAM_4_MEyahoo.com> schreef in bericht
news:uH**************@TK2MSFTNGP15.phx.gbl...
ad wrote:
> Hi,
> How can we get the content of clipboard with program?

client-side (on the user's PC): you can't. you don't have access to it...
server-side:
http://msdn.microsoft.com/library/de...classtopic.asp

--
craig
Microsoft MVP - ASP/ASP.NET

Nov 23 '05 #8
I don't think you listen well, i said client side.
Has nothing to do with ASP.NET etc..

"Juan T. Llibre" <no***********@nowhere.com> schreef in bericht
news:uc*************@TK2MSFTNGP15.phx.gbl...
I would have liked to see sample code for doing that,
in ASP.NET, if it's that easy.

Maybe you didn't take into account that the clipboard class
is in the System.Windows.Forms namespace ( which, as
Craig told you, cannot be accessed by ASP.NET server-side ) ?

Even if it were to be accessed, it would be the *server's* clipboard
that's accessed, if this thing is running server-side, wouldn't it ?

So, that leaves, as the only alternative, to write a client-side program
which captures client data, in sync with the current ASP.NET context,
have the user install it and run it so that the correct data is captured
client-side,
and figure out a way to insert the clipboard's contents to the server, in
context
with the current request.

That last part doesn't seem too complicated, although it's certainly not
"easy".

The first part certainly is complicated, and that's why I wondered why you
described the procedure as "once obtained it is easy to transmit to the
server".

That "once obtained" is what you overlooked.

Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
ASPNETFAQ.COM : http://www.aspnetfaq.com/
Foros de ASP.NET en Español : http://asp.net.do/foros/
======================================
"Edwin Knoppert" <in**@pbsoft.speedlinq.nl> wrote in message
news:dm**********@azure.qinip.net...
I did see this work on a live website, not mine.
It did work.
It was there to proof that the CB could be read.

"Juan T. Llibre" <no***********@nowhere.com> schreef in bericht
news:ug**************@TK2MSFTNGP12.phx.gbl...
re:
MSIE supports obtaining the user's clipboard.
Once obtained it is easy to transmit to the server.

Please post sample code.

Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
ASPNETFAQ.COM : http://www.aspnetfaq.com/
Foros de ASP.NET en Español : http://asp.net.do/foros/
======================================
"Edwin Knoppert" <in**@pbsoft.speedlinq.nl> wrote in message
news:dm**********@azure.qinip.net...
MSIE supports obtaining the user's clipboard.
Once obtained it is easy to transmit to the server.
"Craig Deelsnyder" <cdeelsny@NO_SPAM_4_MEyahoo.com> schreef in bericht
news:uH**************@TK2MSFTNGP15.phx.gbl...
> ad wrote:
>> Hi,
>> How can we get the content of clipboard with program?
>
> client-side (on the user's PC): you can't. you don't have access to
> it... server-side:
> http://msdn.microsoft.com/library/de...classtopic.asp
>
> --
> craig
> Microsoft MVP - ASP/ASP.NET


Nov 23 '05 #9
Hmm, maybe i was to harsh.
But you get the idea.
It must be seen as local stuff.
"Juan T. Llibre" <no***********@nowhere.com> schreef in bericht
news:uc*************@TK2MSFTNGP15.phx.gbl...
I would have liked to see sample code for doing that,
in ASP.NET, if it's that easy.

Maybe you didn't take into account that the clipboard class
is in the System.Windows.Forms namespace ( which, as
Craig told you, cannot be accessed by ASP.NET server-side ) ?

Even if it were to be accessed, it would be the *server's* clipboard
that's accessed, if this thing is running server-side, wouldn't it ?

So, that leaves, as the only alternative, to write a client-side program
which captures client data, in sync with the current ASP.NET context,
have the user install it and run it so that the correct data is captured
client-side,
and figure out a way to insert the clipboard's contents to the server, in
context
with the current request.

That last part doesn't seem too complicated, although it's certainly not
"easy".

The first part certainly is complicated, and that's why I wondered why you
described the procedure as "once obtained it is easy to transmit to the
server".

That "once obtained" is what you overlooked.

Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
ASPNETFAQ.COM : http://www.aspnetfaq.com/
Foros de ASP.NET en Español : http://asp.net.do/foros/
======================================
"Edwin Knoppert" <in**@pbsoft.speedlinq.nl> wrote in message
news:dm**********@azure.qinip.net...
I did see this work on a live website, not mine.
It did work.
It was there to proof that the CB could be read.

"Juan T. Llibre" <no***********@nowhere.com> schreef in bericht
news:ug**************@TK2MSFTNGP12.phx.gbl...
re:
MSIE supports obtaining the user's clipboard.
Once obtained it is easy to transmit to the server.

Please post sample code.

Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
ASPNETFAQ.COM : http://www.aspnetfaq.com/
Foros de ASP.NET en Español : http://asp.net.do/foros/
======================================
"Edwin Knoppert" <in**@pbsoft.speedlinq.nl> wrote in message
news:dm**********@azure.qinip.net...
MSIE supports obtaining the user's clipboard.
Once obtained it is easy to transmit to the server.
"Craig Deelsnyder" <cdeelsny@NO_SPAM_4_MEyahoo.com> schreef in bericht
news:uH**************@TK2MSFTNGP15.phx.gbl...
> ad wrote:
>> Hi,
>> How can we get the content of clipboard with program?
>
> client-side (on the user's PC): you can't. you don't have access to
> it... server-side:
> http://msdn.microsoft.com/library/de...classtopic.asp
>
> --
> craig
> Microsoft MVP - ASP/ASP.NET


Nov 23 '05 #10
re:
Hmm, maybe i was to harsh.
Nah, you weren't "harsh". You were mistaken.
I know it's hard to accept that sometimes.

re: It must be seen as local stuff.
That task is not simply "local stuff". There's a server involved.

Passing the contents of a client's clipboard to an IIS server
running ASP.NET is not a trivial undertaking. Not in the least.

Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
ASPNETFAQ.COM : http://www.aspnetfaq.com/
Foros de ASP.NET en Español : http://asp.net.do/foros/
======================================
"Edwin Knoppert" <ne**@hellobasic.com> wrote in message
news:43**********************@text.nova.planet.nl. .. Hmm, maybe i was to harsh.
But you get the idea.
It must be seen as local stuff.
"Juan T. Llibre" <no***********@nowhere.com> schreef in bericht
news:uc*************@TK2MSFTNGP15.phx.gbl...
I would have liked to see sample code for doing that,
in ASP.NET, if it's that easy.

Maybe you didn't take into account that the clipboard class
is in the System.Windows.Forms namespace ( which, as
Craig told you, cannot be accessed by ASP.NET server-side ) ?

Even if it were to be accessed, it would be the *server's* clipboard
that's accessed, if this thing is running server-side, wouldn't it ?

So, that leaves, as the only alternative, to write a client-side program
which captures client data, in sync with the current ASP.NET context,
have the user install it and run it so that the correct data is captured client-side,
and figure out a way to insert the clipboard's contents to the server, in context
with the current request.

That last part doesn't seem too complicated, although it's certainly not "easy".

The first part certainly is complicated, and that's why I wondered why you
described the procedure as "once obtained it is easy to transmit to the server".

That "once obtained" is what you overlooked.

Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
ASPNETFAQ.COM : http://www.aspnetfaq.com/
Foros de ASP.NET en Español : http://asp.net.do/foros/
======================================
"Edwin Knoppert" <in**@pbsoft.speedlinq.nl> wrote in message
news:dm**********@azure.qinip.net...
I did see this work on a live website, not mine.
It did work.
It was there to proof that the CB could be read.

"Juan T. Llibre" <no***********@nowhere.com> schreef in bericht
news:ug**************@TK2MSFTNGP12.phx.gbl...
re:
> MSIE supports obtaining the user's clipboard.
> Once obtained it is easy to transmit to the server.

Please post sample code.

Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
ASPNETFAQ.COM : http://www.aspnetfaq.com/
Foros de ASP.NET en Español : http://asp.net.do/foros/
======================================
"Edwin Knoppert" <in**@pbsoft.speedlinq.nl> wrote in message
news:dm**********@azure.qinip.net...
> MSIE supports obtaining the user's clipboard.
> Once obtained it is easy to transmit to the server.
>
>
> "Craig Deelsnyder" <cdeelsny@NO_SPAM_4_MEyahoo.com> schreef in bericht
> news:uH**************@TK2MSFTNGP15.phx.gbl...
>> ad wrote:
>>> Hi,
>>> How can we get the content of clipboard with program?
>>
>> client-side (on the user's PC): you can't. you don't have access to it...
>> server-side:
>> http://msdn.microsoft.com/library/de...classtopic.asp
>>
>> --
>> craig
>> Microsoft MVP - ASP/ASP.NET



Nov 23 '05 #11
We must see it differently then.
A js function can be called to obtain the CB, this could be onload.
If you have the CB text you can invoke a post to the server.

What 's not trivial?
Unless you expect to read other CB formats like EMF or so?
"Juan T. Llibre" <no***********@nowhere.com> schreef in bericht
news:%2****************@TK2MSFTNGP12.phx.gbl...
re:
Hmm, maybe i was to harsh.


Nah, you weren't "harsh". You were mistaken.
I know it's hard to accept that sometimes.

re:
It must be seen as local stuff.


That task is not simply "local stuff". There's a server involved.

Passing the contents of a client's clipboard to an IIS server
running ASP.NET is not a trivial undertaking. Not in the least.

Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
ASPNETFAQ.COM : http://www.aspnetfaq.com/
Foros de ASP.NET en Español : http://asp.net.do/foros/
======================================
"Edwin Knoppert" <ne**@hellobasic.com> wrote in message
news:43**********************@text.nova.planet.nl. ..
Hmm, maybe i was to harsh.
But you get the idea.
It must be seen as local stuff.
"Juan T. Llibre" <no***********@nowhere.com> schreef in bericht
news:uc*************@TK2MSFTNGP15.phx.gbl...
I would have liked to see sample code for doing that,
in ASP.NET, if it's that easy.

Maybe you didn't take into account that the clipboard class
is in the System.Windows.Forms namespace ( which, as
Craig told you, cannot be accessed by ASP.NET server-side ) ?

Even if it were to be accessed, it would be the *server's* clipboard
that's accessed, if this thing is running server-side, wouldn't it ?

So, that leaves, as the only alternative, to write a client-side program
which captures client data, in sync with the current ASP.NET context,
have the user install it and run it so that the correct data is captured
client-side,
and figure out a way to insert the clipboard's contents to the server,
in context
with the current request.

That last part doesn't seem too complicated, although it's certainly not
"easy".

The first part certainly is complicated, and that's why I wondered why
you
described the procedure as "once obtained it is easy to transmit to the
server".

That "once obtained" is what you overlooked.

Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
ASPNETFAQ.COM : http://www.aspnetfaq.com/
Foros de ASP.NET en Español : http://asp.net.do/foros/
======================================
"Edwin Knoppert" <in**@pbsoft.speedlinq.nl> wrote in message
news:dm**********@azure.qinip.net...
I did see this work on a live website, not mine.
It did work.
It was there to proof that the CB could be read.

"Juan T. Llibre" <no***********@nowhere.com> schreef in bericht
news:ug**************@TK2MSFTNGP12.phx.gbl...
> re:
>> MSIE supports obtaining the user's clipboard.
>> Once obtained it is easy to transmit to the server.
>
> Please post sample code.
>
> Juan T. Llibre, ASP.NET MVP
> ASP.NET FAQ : http://asp.net.do/faq/
> ASPNETFAQ.COM : http://www.aspnetfaq.com/
> Foros de ASP.NET en Español : http://asp.net.do/foros/
> ======================================
> "Edwin Knoppert" <in**@pbsoft.speedlinq.nl> wrote in message
> news:dm**********@azure.qinip.net...
>> MSIE supports obtaining the user's clipboard.
>> Once obtained it is easy to transmit to the server.
>>
>>
>> "Craig Deelsnyder" <cdeelsny@NO_SPAM_4_MEyahoo.com> schreef in
>> bericht news:uH**************@TK2MSFTNGP15.phx.gbl...
>>> ad wrote:
>>>> Hi,
>>>> How can we get the content of clipboard with program?
>>>
>>> client-side (on the user's PC): you can't. you don't have access to
>>> it... server-side:
>>> http://msdn.microsoft.com/library/de...classtopic.asp
>>>
>>> --
>>> craig
>>> Microsoft MVP - ASP/ASP.NET



Nov 23 '05 #12
And if I have an image in the clipboard ?

Anyway, having your clipboard read by a web page is a security risk.

To make sure your clipboard is not exposed :

1. In Internet Explorer, go to Tools -> Internet Options -> Security
2. Click on Custom Level
3. In the security settings, click to Disable the “Allow Paste Operations via Script.”

That will keep your clipboard text contents private,
and will prevent you from doing what you are proposing to do.

Simply turning off Javascript
( which more and more people are doing these days )
will prevent the reading of text from a client's clipboard, too.

IOW, client behavior is easily derailed, so it's not a general solution.
That lands us right back into the server scenario again, where it simply can't be done.

The idea is not only whether a programming sequence is feasible,
but also whether it's practical, reliable and secure.

Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
ASPNETFAQ.COM : http://www.aspnetfaq.com/
Foros de ASP.NET en Español : http://asp.net.do/foros/
======================================
"Edwin Knoppert" <ne**@hellobasic.com> wrote in message
news:43**********************@text.nova.planet.nl. ..
We must see it differently then.
A js function can be called to obtain the CB, this could be onload.
If you have the CB text you can invoke a post to the server.

What 's not trivial?
Unless you expect to read other CB formats like EMF or so?
"Juan T. Llibre" <no***********@nowhere.com> schreef in bericht
news:%2****************@TK2MSFTNGP12.phx.gbl...
re:
Hmm, maybe i was to harsh.


Nah, you weren't "harsh". You were mistaken.
I know it's hard to accept that sometimes.

re:
It must be seen as local stuff.


That task is not simply "local stuff". There's a server involved.

Passing the contents of a client's clipboard to an IIS server
running ASP.NET is not a trivial undertaking. Not in the least.

Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
ASPNETFAQ.COM : http://www.aspnetfaq.com/
Foros de ASP.NET en Español : http://asp.net.do/foros/
======================================
"Edwin Knoppert" <ne**@hellobasic.com> wrote in message
news:43**********************@text.nova.planet.nl. ..
Hmm, maybe i was to harsh.
But you get the idea.
It must be seen as local stuff.
"Juan T. Llibre" <no***********@nowhere.com> schreef in bericht
news:uc*************@TK2MSFTNGP15.phx.gbl...
I would have liked to see sample code for doing that,
in ASP.NET, if it's that easy.

Maybe you didn't take into account that the clipboard class
is in the System.Windows.Forms namespace ( which, as
Craig told you, cannot be accessed by ASP.NET server-side ) ?

Even if it were to be accessed, it would be the *server's* clipboard
that's accessed, if this thing is running server-side, wouldn't it ?

So, that leaves, as the only alternative, to write a client-side program
which captures client data, in sync with the current ASP.NET context,
have the user install it and run it so that the correct data is captured client-side,
and figure out a way to insert the clipboard's contents to the server, in context
with the current request.

That last part doesn't seem too complicated, although it's certainly not "easy".

The first part certainly is complicated, and that's why I wondered why you
described the procedure as "once obtained it is easy to transmit to the server".

That "once obtained" is what you overlooked.

Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
ASPNETFAQ.COM : http://www.aspnetfaq.com/
Foros de ASP.NET en Español : http://asp.net.do/foros/
======================================
"Edwin Knoppert" <in**@pbsoft.speedlinq.nl> wrote in message
news:dm**********@azure.qinip.net...
>I did see this work on a live website, not mine.
> It did work.
> It was there to proof that the CB could be read.

> "Juan T. Llibre" <no***********@nowhere.com> schreef in bericht
> news:ug**************@TK2MSFTNGP12.phx.gbl...
>> re:
>>> MSIE supports obtaining the user's clipboard.
>>> Once obtained it is easy to transmit to the server.
>>
>> Please post sample code.
>>
>> Juan T. Llibre, ASP.NET MVP
>> ASP.NET FAQ : http://asp.net.do/faq/
>> ASPNETFAQ.COM : http://www.aspnetfaq.com/
>> Foros de ASP.NET en Español : http://asp.net.do/foros/
>> ======================================
>> "Edwin Knoppert" <in**@pbsoft.speedlinq.nl> wrote in message
>> news:dm**********@azure.qinip.net...
>>> MSIE supports obtaining the user's clipboard.
>>> Once obtained it is easy to transmit to the server.
>>>
>>>
>>> "Craig Deelsnyder" <cdeelsny@NO_SPAM_4_MEyahoo.com> schreef in bericht
>>> news:uH**************@TK2MSFTNGP15.phx.gbl...
>>>> ad wrote:
>>>>> Hi,
>>>>> How can we get the content of clipboard with program?
>>>>
>>>> client-side (on the user's PC): you can't. you don't have access to it...
>>>> server-side:
>>>> http://msdn.microsoft.com/library/de...classtopic.asp
>>>>
>>>> --
>>>> craig
>>>> Microsoft MVP - ASP/ASP.NET



Nov 23 '05 #13
>Simply turning off Javascript
Eeek!
I wonder how ASP.NET reacts :)
+ a lot of my code is in javascript
I consider that a minimal requirement.

"Juan T. Llibre" <no***********@nowhere.com> schreef in bericht
news:%2****************@TK2MSFTNGP14.phx.gbl...
And if I have an image in the clipboard ?

Anyway, having your clipboard read by a web page is a security risk.

To make sure your clipboard is not exposed :

1. In Internet Explorer, go to Tools -> Internet Options -> Security
2. Click on Custom Level
3. In the security settings, click to Disable the “Allow Paste Operations
via Script.”

That will keep your clipboard text contents private,
and will prevent you from doing what you are proposing to do.

Simply turning off Javascript
( which more and more people are doing these days )
will prevent the reading of text from a client's clipboard, too.

IOW, client behavior is easily derailed, so it's not a general solution.
That lands us right back into the server scenario again, where it simply
can't be done.

The idea is not only whether a programming sequence is feasible,
but also whether it's practical, reliable and secure.

Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
ASPNETFAQ.COM : http://www.aspnetfaq.com/
Foros de ASP.NET en Español : http://asp.net.do/foros/
======================================
"Edwin Knoppert" <ne**@hellobasic.com> wrote in message
news:43**********************@text.nova.planet.nl. ..
We must see it differently then.
A js function can be called to obtain the CB, this could be onload.
If you have the CB text you can invoke a post to the server.

What 's not trivial?
Unless you expect to read other CB formats like EMF or so?


"Juan T. Llibre" <no***********@nowhere.com> schreef in bericht
news:%2****************@TK2MSFTNGP12.phx.gbl...
re:
Hmm, maybe i was to harsh.

Nah, you weren't "harsh". You were mistaken.
I know it's hard to accept that sometimes.

re:
It must be seen as local stuff.

That task is not simply "local stuff". There's a server involved.

Passing the contents of a client's clipboard to an IIS server
running ASP.NET is not a trivial undertaking. Not in the least.

Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
ASPNETFAQ.COM : http://www.aspnetfaq.com/
Foros de ASP.NET en Español : http://asp.net.do/foros/
======================================
"Edwin Knoppert" <ne**@hellobasic.com> wrote in message
news:43**********************@text.nova.planet.nl. ..
Hmm, maybe i was to harsh.
But you get the idea.
It must be seen as local stuff.
"Juan T. Llibre" <no***********@nowhere.com> schreef in bericht
news:uc*************@TK2MSFTNGP15.phx.gbl...
>I would have liked to see sample code for doing that,
> in ASP.NET, if it's that easy.
>
> Maybe you didn't take into account that the clipboard class
> is in the System.Windows.Forms namespace ( which, as
> Craig told you, cannot be accessed by ASP.NET server-side ) ?
>
> Even if it were to be accessed, it would be the *server's* clipboard
> that's accessed, if this thing is running server-side, wouldn't it ?
>
> So, that leaves, as the only alternative, to write a client-side
> program
> which captures client data, in sync with the current ASP.NET context,
> have the user install it and run it so that the correct data is
> captured client-side,
> and figure out a way to insert the clipboard's contents to the server,
> in context
> with the current request.
>
> That last part doesn't seem too complicated, although it's certainly
> not "easy".
>
> The first part certainly is complicated, and that's why I wondered why
> you
> described the procedure as "once obtained it is easy to transmit to
> the server".
>
> That "once obtained" is what you overlooked.
>
>
>
> Juan T. Llibre, ASP.NET MVP
> ASP.NET FAQ : http://asp.net.do/faq/
> ASPNETFAQ.COM : http://www.aspnetfaq.com/
> Foros de ASP.NET en Español : http://asp.net.do/foros/
> ======================================
> "Edwin Knoppert" <in**@pbsoft.speedlinq.nl> wrote in message
> news:dm**********@azure.qinip.net...
>>I did see this work on a live website, not mine.
>> It did work.
>> It was there to proof that the CB could be read.
>
>> "Juan T. Llibre" <no***********@nowhere.com> schreef in bericht
>> news:ug**************@TK2MSFTNGP12.phx.gbl...
>>> re:
>>>> MSIE supports obtaining the user's clipboard.
>>>> Once obtained it is easy to transmit to the server.
>>>
>>> Please post sample code.
>>>
>>> Juan T. Llibre, ASP.NET MVP
>>> ASP.NET FAQ : http://asp.net.do/faq/
>>> ASPNETFAQ.COM : http://www.aspnetfaq.com/
>>> Foros de ASP.NET en Español : http://asp.net.do/foros/
>>> ======================================
>>> "Edwin Knoppert" <in**@pbsoft.speedlinq.nl> wrote in message
>>> news:dm**********@azure.qinip.net...
>>>> MSIE supports obtaining the user's clipboard.
>>>> Once obtained it is easy to transmit to the server.
>>>>
>>>>
>>>> "Craig Deelsnyder" <cdeelsny@NO_SPAM_4_MEyahoo.com> schreef in
>>>> bericht news:uH**************@TK2MSFTNGP15.phx.gbl...
>>>>> ad wrote:
>>>>>> Hi,
>>>>>> How can we get the content of clipboard with program?
>>>>>
>>>>> client-side (on the user's PC): you can't. you don't have access
>>>>> to it... server-side:
>>>>> http://msdn.microsoft.com/library/de...classtopic.asp
>>>>>
>>>>> --
>>>>> craig
>>>>> Microsoft MVP - ASP/ASP.NET
>
>



Nov 23 '05 #14
re:
Eeek!
heh, heh...

Good reaction ... ;-)

re: I wonder how ASP.NET reacts :)
+ a lot of my code is in javascript
I consider that a minimal requirement.


No web server, no matter the technology used,
can function as efficiently without client-side Javascript as with it.

Some things work fine without JS, like server-side form validation.
Other fail miserably.

Worse, not even detecting browsers can tell you if JS has been disabled,
or even if paste operations via script have been disabled, which many
companies do disable as part of their security policy.

The only way is to test for JS involves using JS. What a catch-22!

If you pass a variable and the variable is there, JS is running.
If it's not there, it's not.


Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
ASPNETFAQ.COM : http://www.aspnetfaq.com/
Foros de ASP.NET en Español : http://asp.net.do/foros/
======================================
"Edwin Knoppert" <ne**@hellobasic.com> wrote in message
news:43**********************@text.nova.planet.nl. ..
Simply turning off Javascript

Eeek!
I wonder how ASP.NET reacts :)
+ a lot of my code is in javascript
I consider that a minimal requirement.

"Juan T. Llibre" <no***********@nowhere.com> schreef in bericht
news:%2****************@TK2MSFTNGP14.phx.gbl...
And if I have an image in the clipboard ?

Anyway, having your clipboard read by a web page is a security risk.

To make sure your clipboard is not exposed :

1. In Internet Explorer, go to Tools -> Internet Options -> Security
2. Click on Custom Level
3. In the security settings, click to Disable the “Allow Paste Operations via Script.”

That will keep your clipboard text contents private,
and will prevent you from doing what you are proposing to do.

Simply turning off Javascript
( which more and more people are doing these days )
will prevent the reading of text from a client's clipboard, too.

IOW, client behavior is easily derailed, so it's not a general solution.
That lands us right back into the server scenario again, where it simply can't be done.

The idea is not only whether a programming sequence is feasible,
but also whether it's practical, reliable and secure.

Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
ASPNETFAQ.COM : http://www.aspnetfaq.com/
Foros de ASP.NET en Español : http://asp.net.do/foros/
======================================
"Edwin Knoppert" <ne**@hellobasic.com> wrote in message
news:43**********************@text.nova.planet.nl. ..
We must see it differently then.
A js function can be called to obtain the CB, this could be onload.
If you have the CB text you can invoke a post to the server.

What 's not trivial?
Unless you expect to read other CB formats like EMF or so?


"Juan T. Llibre" <no***********@nowhere.com> schreef in bericht
news:%2****************@TK2MSFTNGP12.phx.gbl...
re:
> Hmm, maybe i was to harsh.

Nah, you weren't "harsh". You were mistaken.
I know it's hard to accept that sometimes.

re:
> It must be seen as local stuff.

That task is not simply "local stuff". There's a server involved.

Passing the contents of a client's clipboard to an IIS server
running ASP.NET is not a trivial undertaking. Not in the least.

Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
ASPNETFAQ.COM : http://www.aspnetfaq.com/
Foros de ASP.NET en Español : http://asp.net.do/foros/
======================================
"Edwin Knoppert" <ne**@hellobasic.com> wrote in message
news:43**********************@text.nova.planet.nl. ..
> Hmm, maybe i was to harsh.
> But you get the idea.
> It must be seen as local stuff.
>
>
> "Juan T. Llibre" <no***********@nowhere.com> schreef in bericht
> news:uc*************@TK2MSFTNGP15.phx.gbl...
>>I would have liked to see sample code for doing that,
>> in ASP.NET, if it's that easy.
>>
>> Maybe you didn't take into account that the clipboard class
>> is in the System.Windows.Forms namespace ( which, as
>> Craig told you, cannot be accessed by ASP.NET server-side ) ?
>>
>> Even if it were to be accessed, it would be the *server's* clipboard
>> that's accessed, if this thing is running server-side, wouldn't it ?
>>
>> So, that leaves, as the only alternative, to write a client-side program
>> which captures client data, in sync with the current ASP.NET context,
>> have the user install it and run it so that the correct data is captured
>> client-side,
>> and figure out a way to insert the clipboard's contents to the server, in context
>> with the current request.
>>
>> That last part doesn't seem too complicated, although it's certainly not "easy".
>>
>> The first part certainly is complicated, and that's why I wondered why you
>> described the procedure as "once obtained it is easy to transmit to the server".
>>
>> That "once obtained" is what you overlooked.
>>
>>
>>
>> Juan T. Llibre, ASP.NET MVP
>> ASP.NET FAQ : http://asp.net.do/faq/
>> ASPNETFAQ.COM : http://www.aspnetfaq.com/
>> Foros de ASP.NET en Español : http://asp.net.do/foros/
>> ======================================
>> "Edwin Knoppert" <in**@pbsoft.speedlinq.nl> wrote in message
>> news:dm**********@azure.qinip.net...
>>>I did see this work on a live website, not mine.
>>> It did work.
>>> It was there to proof that the CB could be read.
>>
>>> "Juan T. Llibre" <no***********@nowhere.com> schreef in bericht
>>> news:ug**************@TK2MSFTNGP12.phx.gbl...
>>>> re:
>>>>> MSIE supports obtaining the user's clipboard.
>>>>> Once obtained it is easy to transmit to the server.
>>>>
>>>> Please post sample code.
>>>>
>>>> Juan T. Llibre, ASP.NET MVP
>>>> ASP.NET FAQ : http://asp.net.do/faq/
>>>> ASPNETFAQ.COM : http://www.aspnetfaq.com/
>>>> Foros de ASP.NET en Español : http://asp.net.do/foros/
>>>> ======================================
>>>> "Edwin Knoppert" <in**@pbsoft.speedlinq.nl> wrote in message
>>>> news:dm**********@azure.qinip.net...
>>>>> MSIE supports obtaining the user's clipboard.
>>>>> Once obtained it is easy to transmit to the server.
>>>>>
>>>>>
>>>>> "Craig Deelsnyder" <cdeelsny@NO_SPAM_4_MEyahoo.com> schreef in bericht
>>>>> news:uH**************@TK2MSFTNGP15.phx.gbl...
>>>>>> ad wrote:
>>>>>>> Hi,
>>>>>>> How can we get the content of clipboard with program?
>>>>>>
>>>>>> client-side (on the user's PC): you can't. you don't have access to it...
>>>>>> server-side:
>>>>>> http://msdn.microsoft.com/library/de...classtopic.asp
>>>>>>
>>>>>> --
>>>>>> craig
>>>>>> Microsoft MVP - ASP/ASP.NET
>>
>>
>
>



Nov 23 '05 #15
Juan T. Llibre wrote:
re:
MSIE supports obtaining the user's clipboard.
Once obtained it is easy to transmit to the server.


Please post sample code.


Juan, see my reply (sibling post of yours) for a quick example, or one
way of doing it. It does work, but this example is somewhat limited in
its effectiveness.

Which going back to the conversation you and Edwin had (further below in
this thread) there's a lot of reasons to not do this unless you're in a
very controlled environment where you know it's even possible to work
all the time.

--
craig
Microsoft MVP - ASP/ASP.NET
Nov 23 '05 #16
re;
there's a lot of reasons to not do this unless you're in a very controlled environment
where you know it's even possible to work all the time.
Yeah, that's what I've been trying to explain to Edwin in the thread.


Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
ASPNETFAQ.COM : http://www.aspnetfaq.com/
Foros de ASP.NET en Español : http://asp.net.do/foros/
======================================
"Craig Deelsnyder" <cdeelsny@NO_SPAM_4_MEyahoo.com> wrote in message
news:eV****************@TK2MSFTNGP10.phx.gbl... Juan T. Llibre wrote:
re:
MSIE supports obtaining the user's clipboard.
Once obtained it is easy to transmit to the server.


Please post sample code.


Juan, see my reply (sibling post of yours) for a quick example, or one way of doing it.
It does work, but this example is somewhat limited in its effectiveness.

Which going back to the conversation you and Edwin had (further below in this thread)
there's a lot of reasons to not do this unless you're in a very controlled environment
where you know it's even possible to work all the time.

--
craig
Microsoft MVP - ASP/ASP.NET

Nov 23 '05 #17

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: xyz | last post by:
I have a menu item to handle clipboard actions (cut, copy, paste). When I paste text that I copied from a Hungarian web page, the display looks normal on my RichTextBox, but the text retrieved from...
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...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.