2009-05-21 27 views
1

我正在嘗試學習和使用供應商產品的SDK。不幸的是,這些文檔很粗略,我在自己的.NET Framework知識中遇到了一個空白。如何獲取ASP.NET Web應用程序中的Handle.ToInt32()

我有一些Windows窗體應用程序的工作代碼,我試圖讓它在ASP.NET web窗體應用程序中工作。供應商文檔意味着你可以做到這一點,但也許你不能..

片段從工作窗口的應用程序:

using System; 
using System.Drawing; 
using System.Collections; 
using System.ComponentModel; 
using System.Windows.Forms; 
using TRIMSDK; 

private void ConnectUserBtn_Click(object sender, System.EventArgs e) 
{ 
Database db = new Database(); 
Databases dbChooser = new Databases(); 
IDatabase dbI = dbChooser.ChooseOneUI(Handle.ToInt32()); 
if (dbI == null) 
{ 
    return; 
} 
db.Id = dbI.Id; 

現在,這裏是我的點擊事件處理中嘗試了一個.aspx頁面:

using System; 
using System.Collections.Generic; 
using System.Web; 
using System.Web.UI; 
using System.Web.UI.WebControls; 
using TRIMSDK; 

protected void ConnectUserBtn_Click(object sender, EventArgs e) 
{ 
    Database db = new Database(); 
    Databases dbChooser = new Databases(); 
    IDatabase dbI = dbChooser.ChooseOneUI(Handle.ToInt32()); 
    if (dbI == null) 
    { 
     return; 
    } 

我得到了略高於該行編譯投訴寫着「名字‘句柄’並不在當前的背景下存在。

的SDK我想要的T這部分o使用顯示反映產品特性的各種模態對話,以促進「客戶」開發。我擔心它可能只是「Windows客戶端」,ASP.NET Web應用程序無法做到這一點。

有什麼我可以添加解決這個問題?

回答

2

對於web應用程序,模式對話框將在客戶端完成,通常通過javascript和dhtml - 而不是在服務器上(在ASP.NET代碼執行時)。所以我擔心這個產品確實只是winform。

+0

感謝馬克。我懷疑這可能是不可能的。我不知道這種問題是什麼WPF(Windows演示文稿基礎)正在解決... WPF是我的[長]清單上的東西來讀... – 2009-05-21 20:36:59

0

只是通過它:

int hwnd = 0; 

IDatabase dbI = dbChooser.ChooseOneUI(hwnd); 
相關問題