Showing posts with label alli. Show all posts
Showing posts with label alli. Show all posts

Saturday, March 24, 2012

The dreaded asp.clipboard

Hello all

I have the need to copy something to the clipboard via 3rd party type library and then pick it up on the .NET side via the clipboard (all server-side). To complicate the issue, the application needs to be web oriented (ASP.NET)

I have a console version that work, but I can't seem to get the ASP side working. I have included the Forms assembly and I'm able to write to the clipboard via the 3rd party, but the clipboard is always unassigned (null) in ASP.NET when in fact the clipboard can be pasted into PhotoShop

I've searched a lot of articles about this issue. Some suggest that it's a permissions issue. To rule out permissions, I have the site impersonate. The impersonating identity is myself and since I can past into Photoshop, I can only assume my identity has access to the clipboard

Any insight is appreciated

Thanks
Bilthis is a permissions issue. your aspnet account needs permission to
manipulate system resources on the desktop

--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
"Bill Belliveau" <anonymous@.discussions.microsoft.com> wrote in message
news:06D644D5-E7C1-47D1-97AC-826157A1BFA2@.microsoft.com...
> Hello all,
> I have the need to copy something to the clipboard via 3rd party type
> library and then pick it up on the .NET side via the clipboard (all
> server-side). To complicate the issue, the application needs to be web
> oriented (ASP.NET).
> I have a console version that work, but I can't seem to get the ASP side
> working. I have included the Forms assembly and I'm able to write to the
> clipboard via the 3rd party, but the clipboard is always unassigned (null)
> in ASP.NET when in fact the clipboard can be pasted into PhotoShop.
> I've searched a lot of articles about this issue. Some suggest that it's
> a permissions issue. To rule out permissions, I have the site
> impersonate. The impersonating identity is myself and since I can past
> into Photoshop, I can only assume my identity has access to the clipboard.
> Any insight is appreciated.
> Thanks,
> Bill
Alvin,
Thanks for the response

Maybe I'm missing something else then. Before impersionation I tried setting the processModel user to SYSTEM, and had the same problem. I have also added the ASPNET account to the 'run as part of the operation system' policy with no luck

When I call, clipboardData.GetDataPresent(DataFormats.Bitmap) the exception being returned is null object (Object reference not set to an instance of an object.). The most likely cause is permissions, but as far as I can tell I've tried giving the adequate permissions - or am I missing something

Thanks again
Bill
can you impersonate to an authenticated user and see if this works?

Otherwise post your code and i'll work with you on it

--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
"Bill Belliveau" <anonymous@.discussions.microsoft.com> wrote in message
news:C8A65D45-FCD3-4871-A822-79EA22F5E7A7@.microsoft.com...
> Alvin,
> Thanks for the response.
> Maybe I'm missing something else then. Before impersionation I tried
> setting the processModel user to SYSTEM, and had the same problem. I have
> also added the ASPNET account to the 'run as part of the operation system'
> policy with no luck.
> When I call, clipboardData.GetDataPresent(DataFormats.Bitmap) the
> exception being returned is null object (Object reference not set to an
> instance of an object.). The most likely cause is permissions, but as far
> as I can tell I've tried giving the adequate permissions - or am I missing
> something?
> Thanks again.
> Bill

Tuesday, March 13, 2012

The lifecycle of Cache

Hi all:

I want to use System.Web.Caching.Cache in my web application, but I want to
know the lifecycle of Cache (depending on Page, Session or Application ...).
Thanks!

Enoshre:

Quote:

Originally Posted by

I want to know the lifecycle of Cache (depending on Page, Session or Application ...).


One instance of the Cache class is created per application domain,
and it remains valid as long as the application domain remains active.

You can insert items in the Cache :

1. with a key dependency ( When a key dependency changes, the object becomes invalid
and is removed from the cache ). You can opt to have it replaced with a new key dependency.

2. with a file dependency ( When any dependency changes, the object becomes invalid
and is removed from the cache ). You can opt to have it replaced with a new dependency.

3. With a SQLDependency, based on a SQL Server table or query.
When the data changes, so does the cache.

4. with an absoluteExpiration time

5. with a slidingExpiration time

You can also set up a notification when the item is removed from the cache.

See :
http://msdn2.microsoft.com/en-us/library/4y13wyk9.aspx
http://msdn2.microsoft.com/en-us/li...eb.caching.aspx
http://msdn2.microsoft.com/en-us/li...hing.cache.aspx
http://msdn2.microsoft.com/en-us/li...dependency.aspx
For specific usage, see Cache Insert :
http://msdn2.microsoft.com/en-us/li...che.insert.aspx
There's other types of caching, like Output Caching.
You can control its duration with the "Duration parameter :

<%@. OutputCache Duration="#ofseconds"

See :
http://msdn2.microsoft.com/en-us/library/hdxfb6cy.aspx
You can also use partial caching ( caching user controls, for example ):

See:
http://msdn2.microsoft.com/en-us/li...duration.asp x
http://msdn2.microsoft.com/en-us/li...gattribute.aspx
As you can see, there's a number of answers to your question,
depending on the type of caching you perform.

Read the supplied links and decide which type of caching,
and for which duration, is the caching you want to implement.

Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaol : http://asp.net.do/foros/
===================================
"Enosh Chang" <changenosh@.yahoo.com.twwrote in message
news:u5ek0p37GHA.4404@.TK2MSFTNGP04.phx.gbl...

Quote:

Originally Posted by

Hi all:
>
I want to use System.Web.Caching.Cache in my web application, but I want to know the lifecycle of
Cache (depending on Page, Session or Application ...). Thanks!
>
Enosh
>


Juan's answer is good. Just thought I'd mention that the word you are
looking for is "scope", not "lifecycle".

Karl

--
http://www.openmymind.net/
http://www.codebetter.com/
"Enosh Chang" <changenosh@.yahoo.com.twwrote in message
news:u5ek0p37GHA.4404@.TK2MSFTNGP04.phx.gbl...

Quote:

Originally Posted by

Hi all:
>
I want to use System.Web.Caching.Cache in my web application, but I want
to know the lifecycle of Cache (depending on Page, Session or Application
...). Thanks!
>
Enosh
>

The lifecycle of Cache

Hi all:
I want to use System.Web.Caching.Cache in my web application, but I want to
know the lifecycle of Cache (depending on Page, Session or Application ...).
Thanks!
Enoshre:
> I want to know the lifecycle of Cache (depending on Page, Session or Application .
.).
One instance of the Cache class is created per application domain,
and it remains valid as long as the application domain remains active.
You can insert items in the Cache :
1. with a key dependency ( When a key dependency changes, the object become
s invalid
and is removed from the cache ). You can opt to have it replaced with a new
key dependency.
2. with a file dependency ( When any dependency changes, the object becomes
invalid
and is removed from the cache ). You can opt to have it replaced with a new
dependency.
3. With a SQLDependency, based on a SQL Server table or query.
When the data changes, so does the cache.
4. with an absoluteExpiration time
5. with a slidingExpiration time
You can also set up a notification when the item is removed from the cache.
See :
http://msdn2.microsoft.com/en-us/library/4y13wyk9.aspx
http://msdn2.microsoft.com/en-us/li...eb.caching.aspx
http://msdn2.microsoft.com/en-us/li...hing.cache.aspx
http://msdn2.microsoft.com/en-us/li...cy.asp
x
For specific usage, see Cache Insert :
[url]http://msdn2.microsoft.com/en-us/library/system.web.caching.cache.insert.aspx[/url
]
There's other types of caching, like Output Caching.
You can control its duration with the "Duration parameter :
<%@. OutputCache Duration="#ofseconds"
See :
http://msdn2.microsoft.com/en-us/library/hdxfb6cy.aspx
You can also use partial caching ( caching user controls, for example ):
See:
http://msdn2.microsoft.com/en-us/li... />
ation.aspx
http://msdn2.microsoft.com/en-us/li...te.asp
x
As you can see, there's a number of answers to your question,
depending on the type of caching you perform.
Read the supplied links and decide which type of caching,
and for which duration, is the caching you want to implement.
Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaol : http://asp.net.do/foros/
===================================
"Enosh Chang" <changenosh@.yahoo.com.tw> wrote in message
news:u5ek0p37GHA.4404@.TK2MSFTNGP04.phx.gbl...
> Hi all:
> I want to use System.Web.Caching.Cache in my web application, but I want t
o know the lifecycle of
> Cache (depending on Page, Session or Application ...). Thanks!
> Enosh
>
Juan's answer is good. Just thought I'd mention that the word you are
looking for is "scope", not "lifecycle".
Karl
http://www.openmymind.net/
http://www.codebetter.com/
"Enosh Chang" <changenosh@.yahoo.com.tw> wrote in message
news:u5ek0p37GHA.4404@.TK2MSFTNGP04.phx.gbl...
> Hi all:
> I want to use System.Web.Caching.Cache in my web application, but I want
> to know the lifecycle of Cache (depending on Page, Session or Application
> ...). Thanks!
> Enosh
>