[ת]ʹÓÃASPµ÷ÓÃC#дµÄCOM×é¼þ
ת×Ô: http://www.cnblogs.com/rentj1/archive/2009/02/23/1396187.html
1 н¨Àà¿âMyTestDLL
2 ÓÒ»÷ÏîÄ¿“MyTestDLL”-¡·ÊôÐÔ-¡·Éú³É-¡·¹´Ñ¡“ΪCOM»¥²Ù×÷×¢²á”
3 ´ò¿ª AssemblyInfo.cs Îļþ ÐÞ¸Ä [assembly: ComVisible(true)]
4 ´ò¿ªVisual Sutdio 2008 µÄÃüÁîÌáʾÐй¤¾ßÊäÈëguidgen.exe Ñ¡ÔñDEFINE_GUID µ¥»÷ "New GUID"
5´úÂë
1¡¢Ã¿¸öÀàÃû¶ÔÓ¦Ò»¸ö½Ó¿ÚÃû£¬½Ó¿ÚÃûÊÇÀàÃûǰ¼ÓÉÏÒ»¸ö´óдµÄI
2¡¢½Ó¿ÚÖÐÉùÃ÷µÄ·½·¨ÒªÊ¹ÓÃÊôÐÔ [DispId(n)]
3¡¢Àà±ØÐëÓÐÒ»¸öÎ޲ι¹Ô캯Êý
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.InteropServices;
namespace MyTestDll
{
// ÕâÀïGuidΪµÚ4²½Éú³ÉµÄ¡£
[Guid("FFA4B191-FB5B-4dd5-B7B1-B2F32BF6F1FF")]
public interface IMyTestDll
{
[DispId(0)]
string GetAbout();
}
public class Test1:IMyTestDll
{
private string summary;
public Test1()
{
summary = "ÕâÊÇÎҵĵÚÒ»¸ö²âÊÔ";
}
public string GetAbout()
{
return summary;
}
}
}
6 Éú³ÉÏîÄ¿
ASP²âÊÔ´úÂë
<%
Dim o &nbs
Ïà¹ØÎĵµ£º
session
===================================
session¶ÔÏóÓÃÓÚ´æ´¢ÌØ¶¨µÄÓû§»á»°ËùÐèµÄÐÅÏ¢ ¡£ Session¶ÔÏóµÄÒýÈëÊÇΪÁËÃÖ²¹HTTPÐÒéµÄ²»×㣬HTTPÐÒéÊÇÒ»ÖÖÎÞ״̬µÄÐÒé¡£
¡¡¡¡SessionÖÐÎÄÊÇ“»á»°”µÄÒâ˼£¬ÔÚASPÖдú±íÁË·þÎñÆ÷Óë¿Í»§¶ËÖ®¼äµÄ“»á»°”¡£SessionµÄ×÷ÓÃʱ¼ä´ÓÓû§µ½´ïij¸öÌØ¶¨µÄ ......
<%
Response.Buffer = true
Response.Clear
dim url
Dim fso,fl,flsize
dim Dname
Dim objStream,ContentType,flName,isre,url1
Dim strFileName
strFileName=replace(replace(Request("file"),"\",""),"/","") '´«²Î
strFileName="/files/"&strFileName ' ¸Ä³ÉÄãÄãÎļþµÄ´æ ......
£¨±¸×¢£ºÎÄÖкìÉ«×ÖÌåÊÇÎÒÔÚÔÎĵĻù´¡ÉÏÌí¼ÓµÄ½âÊÍ˵Ã÷£©
΢ÈíµÄʵÀý½Ì²ÄÖн²ÁËÈýÖÖÓïÑÔ£ºc#¡¢vb ¡¢Jscript£¬ÎªÁËÈôó¼Ò¹ýÒ»°Ñж«Î÷ñ«£¬ÎÒÃÇ»¹ÊÇѧc#°É¡£Õâ¸ö×îºÃÓÐÒ»µãc++»ù´¡¡£
²»¹ýûÓÐҲûÓйØÏµ£¬´ó²»Á˶à·ÑµãÁ¦ÁË¡£
ÈκÎÒ»ÃÅÓ ......
using System;
using System.Data;
using System.Drawing;
using System.Globalization;
using System.IO;
using System.Windows.Forms;
using Excel = Microsoft.Office.Interop.Excel;
// Ìí¼ÓÒýÓÃ -> .NET -> Microsoft.Office.Interop.Excel(2003->11.0, 2007->12.0)
namespace WinFormTable
{
& ......
±¾ÎÄÁ´½Ó£ºhttp://www.oversteper.com/wprogram/asp/828.html
Ìõ¼þÓï¾äÖ® select case Óï¾ä
1¡¢¶àÌõ¼þ·ÖÖ§µÄʱºòÓÅÏÈʹÓÃselect case½á¹¹£»
2¡¢Êý×ֵĴóÁ¿ÁоÙʱ×îºÃʹÓÃselect case
3¡¢±ØÐëʹÓà end select À´½áÊø·ÖÖ§½á¹¹
ʾÀý£º
ÒÔÏÂΪ ......