asp.net ¶ÁÈ¡SAPÊý¾Ý(rfcÐÎʽȫ¹ý³Ì)
ƽ̨:vs2005,ecc6 ,orcale Êý¾Ý¿â
1.Ê×ÏÈÓÃse37,½¨Á¢Ò»¸ö¶ÁÈ¡º¯Êý,Èçͼ
2.ÏÈÌí¼ÓÈý¸öcom×é¼þInterop.SAPFunctionsOCX.dll,Interop.SAPLogonCtrl.dll,Interop.SAPTableFactoryCtrl.dll
ÏÂÃæµÄ´úÂëÎÒÊÇ×ªÔØÆäËûÍøÕ¾,
ÒÔwebÐÎʽ¶Ôfunction module½øÐе÷ÓÃÓëformÐÎʽ»ù±¾Ò»Ñù,ΨһֵµÃ×¢ÒâµÄµØ·½¾ÍÊÇ:"An ActiveX control must be run in an STA apartment. Because the attribute STAThread is applied to the Main method of a WinForm class by default with a WinForms Project, the main thread of your app will run in STA mode.".Ò²¾ÍÊÇ˵ÓÐЩAcrtiveX¿Ø¼þ»òÕßCom×é¼þ±ØÐëÔËÐÐÔÚµ¥Ï̵߳¥ÔªÏ£¨STA£ºSingle Thread Apartment £©£¬·ñÔòµÄ»°»áÅ׳ö“Bad variant type”Òì³£¡£½â¾ö·½°¸Îª£ºÐ¿ªÒ»¸öỊ̈߳¬²¢½«¸ÃÏ̵߳ÄÔËÐÐģʽÉèÖÃΪSTA£¬È»ºóÔÙ¸ÄÏß³Ì϶ÔCom×é¼þ»òÕßActiveX¿Ø¼þ½øÐе÷Óá£
¶ÔÓ¦µ½ÎÒÃǵÄÊÂÀýÖУ¬Èç¹û²»Ê¹ÓÃSTAģʽÔËÐУ¬ÎÒÃÇ¿ÉÒÔÁ¬½Óµ½SAPϵͳ£¬µ«µ÷ÓÃFunction ModuleµÄʱºò»áÅ׳ö“Bad variant type”Òì³£¡£ËùÒÔÒª½²µ÷ÓÃFunction ModuleµÄ´úÂëÔÚпªµÄÏß³ÌÖÐÖ´ÐС£¾ßÌå²½ÖèÈçÏ£º
Ò»£¬Ìí¼Ó¶ÔInterop.SAPFunctionsOCX.dllÒÔ¼°Interop.SAPLogonCtrl.dllºÍInterop.SAPTableFactoryCtrl.dllcom×é¼þµÄÒýÓá£
¶þ£¬Ð¿ªÒ»¸öỊ̈߳¬²¢½«¸ÃÏ̵߳ÄÔËÐÐģʽÉèÖÃΪSTA. ²¢½«µÇ¼SAPϵͳÒÔ¼°µ÷ÓÃFunction moduleµÄ·½·¨ÔËÐÐÔÚ¸ÃÏß³ÌÏ£¡´úÂëÈçÏ£º
protected void Button1_Click(object sender, EventArgs e)
{
System.Threading.Thread s = new System.Threading.Thread(new System.Threading.ThreadStart(test)); //Create a new thread and set the method test() run in this thread
s.SetApartmentState(System.Threading.ApartmentState.STA); //Set the run mode 'STA'
&
Ïà¹ØÎĵµ£º
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
usin ......
<% @ Page Language = " C# " %>
<! DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >
< script runat ="server" >
System.Data.DataView Crea ......
asp.netºÍajaxδ²¶»ñÒì³£´¦Àí»úÖÆ
ÕâÀïµÄÒì³£´¦ÀíÖ÷ÒªÊÇÖ¸¿ª·¢ÈËÔ±ÔÚÒµÎñ´úÂëÖÐδ²¶»ñµÄÒì³£¡£Î´²¶»ñÒì³£´¦ÀíµÄÄ¿µÄ£º
1£ºÔÚÓ¦ÓóÌÐòÓò¼¶±ð¶ÔÒì³£ÀàÐͽøÐд¦Àí£»
2£ºÔÚ´¦ÀíµÄ»ù´¡ÉÏ£¬¿ÉÒÔ½«´íÎóÐÅÏ¢¼Ç¼ÈÕÖ¾£»
3£ºÒÔÓѺõķ½Ê½Ìáʾ×îÖÕÓà ......
csÎļþ£º
using System.IO;
string context = "";
string path = HttpContext.Current.Server.MapPath("") + "\\test\\test.html";
System.Text.Encoding code = System.Text.Encoding.GetEncoding("utf-8");
Stre ......
ÔÎÄ£ºÁõÎä
| ASP.NET ·þÎñÆ÷¿Ø¼þÉúÃüÖÜÆÚ
âÒ¶¡½âÅ£:×ÝÏòÇÐÈëASP.NET 3.5¿Ø¼þºÍ×é¼þ¿ª·¢¼¼Êõ
µÚÒ»Õ½²ÁËһЩ·þÎñÆ÷¿Ø¼þµÄ»ù±¾ÖªÊ¶£¬
ÆäÖÐasp.net·þÎñÆ÷¿Ø¼þµÄÉúÃüÖÜÆÚ£¬ÊÇ¿ª·¢¿Ø¼þµÄµÚÒ»²½£¬Ò²ÊǺËÐÄ¡£
·þÎñÆ÷¿Ø¼þÉúÃüÖÜÆÚ°üÀ¨ÒÔÏÂ11¸ö½×¶Î£º
³õʼ»¯£¨OnInit)£ºÍê³É¿Ø¼þµÄ³õʼ»¯¼°´ò¿ª¿Ø¼þµÄÊÓͼ״̬¸ ......