Use Windows Form Controls in IE Browser (3)

xiaoxiao2021-03-06  105

Debug Windows Form Control

To adjust the form control, you need to follow the steps below.

1. Open the browser and request the HTML page containing the form control.

2. Open Visual Studio.NET Simultaneously Select Tools -> Debug Process Displays the following dialog box.

In this Process dialog box, select IExplore.exe Click the attach button. When you click on the additional button, you will jump out a dialog prompting you to select the type of programs you want to debug. We have chosen two items, as shown below:

Determine the top window and process window close.

Open User Control File AuthorsWebServiceClient.cs via the VS.NET file menu, set breakpoints in the source code. This once you set a breakpoint, you can debug this control, as shown below.

Windows Forms Code Access Permissions

Just like we have previously discussed. When the form control is executed in IE, he uses the permissions provided by the .NET runtime. To figure out how the control uses code access to the code provided by .NET to run in IE, let's go back in front, add the following code in the Form Control Load Event:

Private void authorscontrol_load (Object Sender, System.EventArgs E)

{

IF (! EventLog.Sourceexists ("testsource")))

EventLog.createEventSource ("Testsource", "Testlog");

Else

{

EventLog.DeleteEventsource ("testsource");

EventLog.createEventSource ("Testsource", "Testlog");

}

}

In the above code, we determine if there is a "TestLog" log source on the web server. If we do not exist, create him if we don't exist, if there is, delete the rebuild. Just like you expect, do more permissions, so the above code will not work properly through the Internet, you will see the following prompt window.

Through the above window we can clearly see your access is restricted by the .NET runtime.

When using the form control in IE, you need to realize his strengths and limitations. The main advantages include:

1. Implement a rich dynamic interface through web.

2. Seamlessly combined. NET code security strategy.

3. Preferably, the performance of Java Applets.

Restrictions include:

1. Client needs to be a Windows operating system

2. Need IE6.0 support

3. The client needs to install the .NET runtime environment

4. Server-side needs to be Window2000 and IIS5.0 or higher

Due to the above limit, it may be advantageous to transmit the client and server-side data. For example, because the WINDOWS Form Control is installed in the client IE, we can write some code to determine if the client is installed with .NET Runtime, we can get the version number through this feature, otherwise Will get 0.0.

in conclusion

In this article, we discussed how to use browsing form controls in IE and debug in the process. At the same time, I also said that the .NET code accesses security control in IE.

Although the implementation of this technology requires client installation .Net runtime, we can believe that in the future Windows operating system will integrate .NET Framework, Windows2003 is a good example.

Finally, I hope that you will find this article to help you, thank you for reading.

About the Author

Thiru has almost six years of experience in architecting, designing, developing and implementing applications using Object Oriented Application development methodologies. He also possesses a thorough understanding of software life cycle (design, development and testing) .He is an expert with ASP.NET, .NET Framework, Visual C # .NET, Visual Basic.Net, ADO.NET, XML Web Services and .NET Remoting and Holds McAd for .NET, MCSD and MCP Certifications.

.

转载请注明原文地址:https://www.9cbs.com/read-124919.html

New Post(0)