473,856 Members | 1,794 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Still the same problem with embedding Windows Control

Hi,

I still have the same problem with embedding Windows Control. I'll just
requote what I posted last time:

[QUOTE START]

I managed to create a Windows Form Control and put it on my ASP .NET page. I
have done the suggestion that is provided by modifying the security settings.
From the stack trace, I would assume that the code throws exception when it
is trying to retrieve the processes list that has certain name. Below is the
code that I use to retrieve the processes.

Process[] processes = Process.GetProc essesByName("xx xx");

The above code is the first line within the method IsProcessRunnin g() which
is the top on the stack trace.

Could anyone help me on this?

Below is the error that I get:

See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.Security .SecurityExcept ion: Request failed.
at QControl.ACCtio n.AccessButton. IsProcessRunnin g()
at QControl.ACCtio n.AccessButton. btnAccess_Click (Object sender, EventArgs
e)
at System.Windows. Forms.Control.O nClick(EventArg s e)
at System.Windows. Forms.Button.On Click(EventArgs e)
at System.Windows. Forms.Button.On MouseUp(MouseEv entArgs mevent)
at System.Windows. Forms.Control.W mMouseUp(Messag e& m, MouseButtons
button, Int32 clicks)
at System.Windows. Forms.Control.W ndProc(Message& m)
at System.Windows. Forms.ButtonBas e.WndProc(Messa ge& m)
at System.Windows. Forms.Button.Wn dProc(Message& m)
at System.Windows. Forms.ControlNa tiveWindow.OnMe ssage(Message& m)
at System.Windows. Forms.ControlNa tiveWindow.WndP roc(Message& m)
at System.Windows. Forms.NativeWin dow.Callback(In tPtr hWnd, Int32 msg,
IntPtr wparam, IntPtr lparam)

The granted set of the failing assembly was:
<PermissionSe t class="System.S ecurity.Permiss ionSet"
version="1">
<IPermission class="System.S ecurity.Permiss ions.Environmen tPermission,
mscorlib, Version=1.0.500 0.0, Culture=neutral ,
PublicKeyToken= b77a5c561934e08 9"
version="1"
Unrestricted="t rue"/>
<IPermission class="System.S ecurity.Permiss ions.FileDialog Permission,
mscorlib, Version=1.0.500 0.0, Culture=neutral ,
PublicKeyToken= b77a5c561934e08 9"
version="1"
Unrestricted="t rue"/>
<IPermission class="System.S ecurity.Permiss ions.FileIOPerm ission,
mscorlib, Version=1.0.500 0.0, Culture=neutral ,
PublicKeyToken= b77a5c561934e08 9"
version="1"
Unrestricted="t rue"/>
<IPermission
class="System.S ecurity.Permiss ions.IsolatedSt orageFilePermis sion, mscorlib,
Version=1.0.500 0.0, Culture=neutral , PublicKeyToken= b77a5c561934e08 9"
version="1"
Unrestricted="t rue"/>
<IPermission class="System.S ecurity.Permiss ions.Reflection Permission,
mscorlib, Version=1.0.500 0.0, Culture=neutral ,
PublicKeyToken= b77a5c561934e08 9"
version="1"
Unrestricted="t rue"/>
<IPermission class="System.S ecurity.Permiss ions.RegistryPe rmission,
mscorlib, Version=1.0.500 0.0, Culture=neutral ,
PublicKeyToken= b77a5c561934e08 9"
version="1"
Unrestricted="t rue"/>
<IPermission class="System.S ecurity.Permiss ions.SecurityPe rmission,
mscorlib, Version=1.0.500 0.0, Culture=neutral ,
PublicKeyToken= b77a5c561934e08 9"
version="1"
Unrestricted="t rue"/>
<IPermission class="System.S ecurity.Permiss ions.UIPermissi on, mscorlib,
Version=1.0.500 0.0, Culture=neutral , PublicKeyToken= b77a5c561934e08 9"
version="1"
Unrestricted="t rue"/>
<IPermission class="System.N et.DnsPermissio n, System, Version=1.0.500 0.0,
Culture=neutral , PublicKeyToken= b77a5c561934e08 9"
version="1"
Unrestricted="t rue"/>
<IPermission class="System.D rawing.Printing .PrintingPermis sion,
System.Drawing, Version=1.0.500 0.0, Culture=neutral ,
PublicKeyToken= b03f5f7f11d50a3 a"
version="1"
Unrestricted="t rue"/>
<IPermission class="System.D iagnostics.Even tLogPermission, System,
Version=1.0.500 0.0, Culture=neutral , PublicKeyToken= b77a5c561934e08 9"
version="1"
Unrestricted="t rue"/>
<IPermission class="System.N et.SocketPermis sion, System,
Version=1.0.500 0.0, Culture=neutral , PublicKeyToken= b77a5c561934e08 9"
version="1"
Unrestricted="t rue"/>
<IPermission class="System.N et.WebPermissio n, System, Version=1.0.500 0.0,
Culture=neutral , PublicKeyToken= b77a5c561934e08 9"
version="1"
Unrestricted="t rue"/>
<IPermission class="System.D iagnostics.Perf ormanceCounterP ermission,
System, Version=1.0.500 0.0, Culture=neutral , PublicKeyToken= b77a5c561934e08 9"
version="1"
Unrestricted="t rue"/>
<IPermission class="System.D irectoryService s.DirectoryServ icesPermission,
System.Director yServices, Version=1.0.500 0.0, Culture=neutral ,
PublicKeyToken= b03f5f7f11d50a3 a"
version="1"
Unrestricted="t rue"/>
<IPermission class="System.M essaging.Messag eQueuePermissio n,
System.Messagin g, Version=1.0.500 0.0, Culture=neutral ,
PublicKeyToken= b03f5f7f11d50a3 a"
version="1"
Unrestricted="t rue"/>
<IPermission class="System.S erviceProcess.S erviceControlle rPermission,
System.ServiceP rocess, Version=1.0.500 0.0, Culture=neutral ,
PublicKeyToken= b03f5f7f11d50a3 a"
version="1"
Unrestricted="t rue"/>
<IPermission class="System.D ata.OleDb.OleDb Permission, System.Data,
Version=1.0.500 0.0, Culture=neutral , PublicKeyToken= b77a5c561934e08 9"
version="1"
Unrestricted="t rue"/>
<IPermission class="System.D ata.SqlClient.S qlClientPermiss ion,
System.Data, Version=1.0.500 0.0, Culture=neutral ,
PublicKeyToken= b77a5c561934e08 9"
version="1"
Unrestricted="t rue"/>
<IPermission class="System.S ecurity.Permiss ions.SiteIdenti tyPermission,
mscorlib, Version=1.0.500 0.0, Culture=neutral ,
PublicKeyToken= b77a5c561934e08 9"
version="1"
Site="localhost "/>
<IPermission class="System.S ecurity.Permiss ions.UrlIdentit yPermission,
mscorlib, Version=1.0.500 0.0, Culture=neutral ,
PublicKeyToken= b77a5c561934e08 9"
version="1"
Url="http://localhost/ActiveXAspTeste r/QControl.dll"/>
<IPermission class="System.S ecurity.Permiss ions.ZoneIdenti tyPermission,
mscorlib, Version=1.0.500 0.0, Culture=neutral ,
PublicKeyToken= b77a5c561934e08 9"
version="1"
Zone="Intranet"/>
</PermissionSet>

************** Loaded Assemblies **************
mscorlib
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.573
CodeBase: file:///c:/winnt/microsoft.net/framework/v1.1.4322/mscorlib.dll
----------------------------------------
System
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.573
CodeBase:
file:///c:/winnt/assembly/gac/system/1.0.5000.0__b77 a5c561934e089/system.dll
----------------------------------------
System.Drawing
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.573
CodeBase:
file:///c:/winnt/assembly/gac/system.drawing/1.0.5000.0__b03 f5f7f11d50a3a/system.drawing. dll
----------------------------------------
System.Director yServices
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.573
CodeBase:
file:///c:/winnt/assembly/gac/system.director yservices/1.0.5000.0__b03 f5f7f11d50a3a/system.director yservices.dll
----------------------------------------
System.Messagin g
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.573
CodeBase:
file:///c:/winnt/assembly/gac/system.messagin g/1.0.5000.0__b03 f5f7f11d50a3a/system.messagin g.dll
----------------------------------------
System.ServiceP rocess
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.573
CodeBase:
file:///c:/winnt/assembly/gac/system.servicep rocess/1.0.5000.0__b03 f5f7f11d50a3a/system.servicep rocess.dll
----------------------------------------
System.Data
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.573
CodeBase:
file:///c:/winnt/assembly/gac/system.data/1.0.5000.0__b77 a5c561934e089/system.data.dll
----------------------------------------
RegexAssembly8_ 0
Assembly Version: 0.0.0.0
Win32 Version: n/a
CodeBase:
----------------------------------------
QControl
Assembly Version: 1.0.0.0
Win32 Version: n/a
CodeBase: http://localhost/ActiveXAspTester/QControl.dll
----------------------------------------
System.Windows. Forms
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.573
CodeBase:
file:///c:/winnt/assembly/gac/system.windows. forms/1.0.5000.0__b77 a5c561934e089/system.windows. forms.dll
----------------------------------------
Microsoft.mshtm l
Assembly Version: 7.0.3300.0
Win32 Version: 7.0.3300.0
CodeBase:
file:///c:/winnt/assembly/gac/microsoft.mshtm l/7.0.3300.0__b03 f5f7f11d50a3a/microsoft.mshtm l.dll
----------------------------------------
Accessibility
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.573
CodeBase:
file:///c:/winnt/assembly/gac/accessibility/1.0.5000.0__b03 f5f7f11d50a3a/accessibility.d ll
----------------------------------------

************** JIT Debugging **************
To enable just in time (JIT) debugging, the config file for this
application or machine (machine.config ) must have the
jitDebugging value set in the system.windows. forms section.
The application must also be compiled with debugging
enabled.

For example:

<configuratio n>
<system.windows .forms jitDebugging="t rue" />
</configuration>

When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the machine
rather than being handled by this dialog.

[QUOTE END]
If you guys are curious with the security check, this is what I wrote before

[QUOTE START]

I created a new Permission set that has unrestricted access on all resources
(DNS, Event Log, File IO etc) on Machine Level. After that I created a new
child code group (still at Machine Level) under LocalIntranet_Z one that has
this permission set. After that I called my application through
http://localhost/ActiveXAspTester. Hope that helps.

[QUOTE END]

I have also tried to execute Win32 API from my C# code using EnumProcesses,
OpenProcess, EnumProcessModu les and GetModuleFileNa meEx, but when I called
EnumProcessModu les, somehow they give me error of being Access is Denied (net
helpmsg 5). Is there any other insight how to solve the problem?

Regards,
Budhi

Sep 20 '06 #1
0 2072

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

Similar topics

2
1723
by: FinallyInSeattle | last post by:
I have an old product that generates a Word document using Word Automation (tables, pictures, etc). The execution speed is quite slow and I'm finally at the point where I can tell my customers that they HAVE to have Office 2003. That brings me to the potential of using .NET and building a Word document using Word XML instead. The document won't have a specific format - this product randomly produces a test by writing out question...
1
545
by: Raghavendran Muraleetharan | last post by:
I have a requirement where I need to embed a VB 6 forms application into .Net forms application. Basically the new .Net application would act as a wrapper application and would control the embedded VB 6 application. I tried to start the VB 6 in a separate process from dot net app and acquired the handle of the handle to the main window of the process. Next I used to use Win32 API function SetParent to set the parent of the VB 6...
1
465
by: SammyBar | last post by:
Hi all, I'd like to use html/xml/xsl for rendering views in a windows form client. I assume I should embed IE inside a windows form in order to show the form inside a MDI form. I should also capture events from the IE at the windows form level. Can you point me to any hints, sample code? Thanks in advance Sammy
2
1434
by: Martin Eyles | last post by:
I would like to embed a windows controls or smart client controls in a web page, in a similar way to which a java applet or a flash applet or an active x control is embedded. I read something somewhere about compiling the control to a dll, and then putting this dll in the web server directory, and setting the classid to the url to this. Is there a way of doing this all automatically as part of one project, or one solution? Also, is...
6
8102
by: BobAchgill | last post by:
Has anyone had success with writing text using a private font that was not already installed to the system? When I try the example code in NET Framework Developer's Guide called “Creating a Private Font Collection” .... I only see a default font written to the form NOT the private font that was loaded. Ofcourse I see the right font written if the font is already one that is installed in the system. But if the private font that I...
24
2874
by: Dave | last post by:
I understand that VS.NET is supposed to compile native Win32 apps that do not require the .Net runtime. If that's the case then there is something else from the VS200x package that is required. MSVCR80.DLL and MSVCR80D.DLL are present and accounted for in Windows\System32. This is something else. Message says that the application configuration is incorrect. I just compiled a simple "Hello.cpp" app that exhibits the same behavior so...
3
13681
by: Ollie Riches | last post by:
How do I embed a *.flv file (Flash Video) into an aspx page similar to embedding windows media player active x control? Cheers Ollie Riches
0
332
by: dr | last post by:
Is there any activex or .net control for embedding the Windows Picture and Fax Viewer into my application?
53
2685
by: None | last post by:
Hi, I am a game developer, sometimes "indy" and sometimes for a small-sized company. I can't speak for all game developers, but everywhere I've ever seen people working on games, execution speed has always been the most important constraint in writing code. Writing readable and maintainable code is important, but takes a back seat to execution speed. I work with DirectX and/or OpenGL, always in C++. There are plenty of things that...
0
9763
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10787
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10390
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9534
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 projectplanning, coding, testing, and deploymentwithout human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
7098
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5960
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4578
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4176
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3203
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.