PC Review


Reply
Thread Tools Rate Thread

How to determine a IE embedded control be full trusted?

 
 
idiot
Guest
Posts: n/a
 
      30th Aug 2006
When I call PolicyHierarchy method in the IE embedded usercontrol, the html
page prompt script error message "security error". It seems that there is no
"SecurityException"?

Html page code :
<OBJECT id='Object1' height=100% width=100%
classid='http:Web.MainFrame.dll#Web.MainFrame.UserControlLogin'
VIEWASTEXT VIEWASTEXT>Failed
</OBJECT>
<script language=javascript>
if(Object1.CheckPolicy())
{
....
}
else
{
....
}
</script>

IE embedded winform unsercontrol
Code :
public void CheckPolicy()
{
try
{
IEnumerator levels = System.Security.SecurityManager.PolicyHierarchy();

while (levels.MoveNext())
{
PolicyLevel level = (PolicyLevel)levels.Current;

CodeGroup group = level.RootCodeGroup;

if (level.Label.ToString( ) == "Machine")
{
if (group.MembershipCondition.ToString( ) == "All code")
{
for(int i=0;i<group.Children.Count;i++)
{
CodeGroup subgroup = group.Children[i] as CodeGroup;
if(subgroup.Name=="[PRODUCT NAME]")
return true;
}
}
}
}

return false;
}
catch(Exception e)
{
return false;
}
}



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to determine if a chart is embedded or not deltaquattro Microsoft Excel Programming 7 22nd Jan 2010 05:19 PM
How to determine a IE embedded control be full trusted? idiot Microsoft Dot NET Framework Forms 0 22nd Aug 2006 10:43 AM
Hi, how do I create a partial trusted sandbox of an embedded scriptingengine (IronPython for example) for asp.net? Li-fan Chen Microsoft Dot NET Framework 0 6th Jun 2006 04:01 PM
How does MS AntiSpyware determine trusted applications? Zabersoft Inc. Spyware Discussion 1 9th Feb 2005 01:29 AM
Determine embedded file properties =?Utf-8?B?TVJvYmFyZQ==?= Microsoft Powerpoint 1 15th Sep 2004 11:06 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:48 PM.