Re: How to get the contnet of clipboard

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



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" <news@xxxxxxxxxxxxxx> wrote in message
news:43847228$0$2344$ba620dc5@xxxxxxxxxxxxxxxxxxxxxx
> >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" <nomailreplies@xxxxxxxxxxx> schreef in bericht
> news:%23alEfpC8FHA.4012@xxxxxxxxxxxxxxxxxxxxxxx
>> 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" <news@xxxxxxxxxxxxxx> wrote in message
>> news:4384568b$0$2340$ba620dc5@xxxxxxxxxxxxxxxxxxxxxx
>>> 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" <nomailreplies@xxxxxxxxxxx> schreef in bericht
>>> news:%23FwUkaB8FHA.2364@xxxxxxxxxxxxxxxxxxxxxxx
>>>> 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" <news@xxxxxxxxxxxxxx> wrote in message
>>>> news:43843c2e$0$2337$ba620dc5@xxxxxxxxxxxxxxxxxxxxxx
>>>>> Hmm, maybe i was to harsh.
>>>>> But you get the idea.
>>>>> It must be seen as local stuff.
>>>>>
>>>>>
>>>>> "Juan T. Llibre" <nomailreplies@xxxxxxxxxxx> schreef in bericht
>>>>> news:ucrg1pA8FHA.252@xxxxxxxxxxxxxxxxxxxxxxx
>>>>>>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" <info@xxxxxxxxxxxxxxxxxxx> wrote in message
>>>>>> news:dm0ilh$k67$1@xxxxxxxxxxxxxxxxxx
>>>>>>>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" <nomailreplies@xxxxxxxxxxx> schreef in bericht
>>>>>>> news:ugb7t367FHA.1864@xxxxxxxxxxxxxxxxxxxxxxx
>>>>>>>> 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" <info@xxxxxxxxxxxxxxxxxxx> wrote in message
>>>>>>>> news:dm026q$gjh$1@xxxxxxxxxxxxxxxxxx
>>>>>>>>> MSIE supports obtaining the user's clipboard.
>>>>>>>>> Once obtained it is easy to transmit to the server.
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> "Craig Deelsnyder" <cdeelsny@xxxxxxxxxxxxxxxxxxxxx> schreef in bericht
>>>>>>>>> news:uHJttk67FHA.2616@xxxxxxxxxxxxxxxxxxxxxxx
>>>>>>>>>> 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/default.asp?url=/library/en-us/cpref/html/frlrfsystemwindowsformsclipboardclasstopic.asp
>>>>>>>>>>
>>>>>>>>>> --
>>>>>>>>>> craig
>>>>>>>>>> Microsoft MVP - ASP/ASP.NET
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
>


.



Relevant Pages

  • Re: advantage of document.write
    ... Of course using a programming language to generate your HTML makes only ... Sow would you create a button that can only be used if Javascript is enabled? ... How would you add a button that copies text to the clipboard? ... How would you add the current date - according to my system clock - with server side code? ...
    (comp.lang.javascript)
  • Re: How to get the contnet of clipboard
    ... >Simply turning off Javascript ... having your clipboard read by a web page is a security risk. ... > Simply turning off Javascript ... >> If you have the CB text you can invoke a post to the server. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Annoying pop-up in Internet Explorer
    ... the topic of THIS newsgroup. ... So are you in charge of that web site? ... 'Do you want to allow this web page to access your clipboard? ... example of HTML code that uses javascript to paste to the clipboard is ...
    (microsoft.public.outlook.general)
  • Re: Windows Security Flaw - The Clipboard
    ... but it is also very easy for a client-side JavaScript ... function to grab the clipboard contents, append it to a URL as a parameter ... > Client side and server side script ain't the same. ...
    (microsoft.public.windowsxp.security_admin)
  • reading clipboard
    ... to the windows clipboard. ... user's clipboard in windows. ... I realise that its a job for javascript on the client side. ... I rather suspect that I need to make a jasvascript function but have no idea ...
    (comp.lang.javascript)