별로 ^^; 특별한 팁은 아니지만,,, 그래도 하나의 "아이디어" 라고 할만한 것이기에 소개합니다.
그러니까, 문제는 스마트 클라이언트의 "이벤트" 발생이 기본적인 "Internet_Zone" 에 위배되기 때문에 어쩔 수 없이 클라이언트 측에 보안설정을 강요받게 되는 데요.
만약, 순전히 이벤트로 인한 보안설정만 필요한 경우라면 다음의 팁으로 해결하시는 것을 권해 드립니다.
모든 상황에서 쓸 수 있는 방법은 아니지만, 적절하게 쓸 수 있는 상황도 있을 것 같기 때문에. ^^
소스 출처 : http://msdn.microsoft.com/msdnmag/issues/04/10/WebQA/default.aspx
Q We are considering hosting a Windows Forms control in an Internet Explorer Web browser for an intranet Web application. In order to avoid the issue of passing managed events from the Windows Forms control back to unmanaged JScript® code (we may not be able to ask all of our users to make the security changes necessary to allow this), I am thinking of having the JScript code poll the Windows Forms control (maybe four times per second) inquiring, basically, whether any events have fired that the JScript code needs to know about. In rough form, the JScript would look something like this:
window.setInterval(checkWinformEvents, 250);
var bCheckingEvents;
function checkWinformEvents() {
if(!bCheckingEvents) {
bCheckingEvents = true;
var sEvents = objWinform.AnyEventsToReport();
bCheckingEvents = false;
if (sEvents) handleWinformEvents(sEvents) ;
}
}
The managed method, AnyEventsToReport, would then return something like "Double-click on line 14 of List view," and so on. Is it a good idea to check Windows Forms events from JScript?
A Having the JScript code poll the Windows Forms control seems a little weird, but it would give you a workaround for the security restrictions put in place by Internet Explorer. There are a few problems with the code snippet, but nothing that is insurmountable. For instance, where exactly do you make the second call to setInterval? No loop is evident.
The bottom line is that this program is really not robust in the face of exceptions. Plus, there's some uninitialized data in there and you treat a string as a bool, which is a bad idea. Also, why are you doing a re-entrancy check on a method which is not recursive?
You should probably write it like this instead:
window.setInterval(checkWinformEvents, 250) ;
function checkWinformEvents()
{
try
{
handleWinformEvents(winform.AnyEventsToReport());
}
finally
{
window.setInterval(checkWinformEvents, 250) ;
}
}
[Editor's Update - 12/6/2004: setInterval evaluates an expression each time a specified number of milliseconds has elapsed and until the timer is removed with the clearInterval method. As such, it does not need to be called again every time the checkWinformEvents function is invoked.]
No | Writer | Date | Cnt. | Title | File(s) |
69 | 정성태 | 10/27/2006 | 3997 | .NET : 1. Typed DataSet 에서의 ExcludeSchema 사용 | |
68 | 정성태 | 1/27/2007 | 4497 | Vista : 2. Elevate through ShellExecute | |
67 | 정성태 | 10/22/2006 | 3733 | Vista : 1. Programmatically determine if an application requires elevation | |
66 | 정성태 | 9/22/2006 | 3645 | Tip/Trick: UpdateProgress Control and AJAX Activity Image Animations | |
65 | 정성태 | 9/15/2006 | 8937 | Tip/Trick: Enabling Back/Forward-Button Support for ASP.NET AJAX UpdatePanel | |
64 | 정성태 | 2/23/2007 | 3852 | Why are NameValueCollection lookups slower than Hashtable? [Kim Hamilton] | |
63 | 정성태 | 8/30/2006 | 3728 | WinFormResizer for .NET 2.0, v.2.0.0020.3 Released! | |
62 | 정성태 | 8/21/2006 | 3554 | Stylistic differences in using | |
61 | 정성태 | 8/5/2006 | 3740 | Detecting Information Card Support (CardSpace!) in a browser | |
60 | 정성태 | 7/22/2006 | 3513 | JonGallant WebControls v1.0 - ScrollableContainer | |
59 | 정성태 | 3/2/2006 | 4787 | .NET이 왜 성공할 수밖에 없는가? | |
58 | 정성태 | 10/5/2005 | 4604 | 한국 MSDN - 홈지기가 번역한 MSDN Magazine 자료 | |
57 | 정성태 | 5/5/2005 | 4030 | 구구단 프로그램을 제외하고, 벤더종속적이지 않은 프로그래밍 언어가 있나요? | |
53 | 정성태 | 3/4/2005 | 5298 | [마소 연재 기사: 2004-05] 특집 X-Inernet : 닷넷 스마트 클라이언트 [4] | 1 |
52 | 정성태 | 3/4/2005 | 5558 | [마소 연재 기사: 2004-04] 실전!강의실 - IE에서 닷넷 스마트 클라이언트 개발 3 | 1 |
51 | 정성태 | 3/4/2005 | 5867 | [마소 연재 기사: 2004-03] 실전!강의실 - IE에서 닷넷 스마트 클라이언트 개발 2 | 1 |
55 | 정성태 | 3/30/2005 | 4385 | [추가] 기본 보안만으로 구현하는 스마트 클라이언트 이벤트 구현 | |
50 | 정성태 | 3/4/2005 | 7926 | [마소 연재 기사: 2004-02] 실전!강의실 - IE에서 닷넷 스마트 클라이언트 개발 1 [3] | 1 |
49 | 정성태 | 9/7/2006 | 7189 | RSA 공개키/개인키 암호화, DES 암호화, MD5 단방향 해시 암호화 클래스 (C#) 2002.09.25 | 1 |
48 | 정성태 | 7/17/2003 | 5122 | C# 으로 만든 Base64 인코딩/디코딩 클래스 (C#) 2002.09.24 | 1 |
47 | 정성태 | 7/17/2003 | 4041 | C# 으로 만든 DLL 을 Managed C++ 에서 이용하는 예제 (C#, Managed C++) 2002.08.01 | 1 |
46 | 정성태 | 7/17/2003 | 4209 | .NET으로 만든 COM+ 객체를 HTML에서 사용 (C#, COM+) 2002.06.10 | 1 |
45 | 정성태 | 7/17/2003 | 4359 | COM+ 객체 원격 접근예제 (VC 6.0, ATL, COM+) 2002.05.31 | 1 |
44 | 정성태 | 7/17/2003 | 4310 | Win32 API Hook (VC 6.0, ATL) 2002.05.12 | 1 |
54 | 정성태 | 3/21/2005 | 3826 | [추가]: 최근 나온 소개된 관련 기사 | 2 |
43 | 정성태 | 7/17/2003 | 5267 | 탐색기 Namespace Extension 컨테이너 (VC 6.0, ATL) 2002.03.24 | 1 |