C#±àдCom×é¼þ
1¡¢Ð½¨Ò»¸öÀà¿âÏîÄ¿
2¡¢½«Class1.cs¸ÄΪÎÒÃÇÏëÒªµÄÃû×Ö
ÎÊÊÇ·ñͬʱ¸øÀà¸ÄÃû£¬È·¶¨
3¡¢ÐÞ¸ÄPropertiesĿ¼ÏÂÃæµÄAssemblyInfo.cs
ComVisibleÊôÐÔÉèÖÃΪTrue
4¡¢ÏîÄ¿²Ëµ¥->MyLibÊôÐÔ
ÕÒµ½“Éú³É”Ñ¡Ï
ÍùÏ¿´£¬ÕÒµ½“Ϊ COM Interop ×¢²á”¹´ÉÏ
5¡¢¼ÌÐøÍùÏ£¬ÕÒµ½“Ç©Ãû”Ñ¡Ï
¹´ÉϓΪ³ÌÐò¼¯Ç©Ãû”
ÔÚÏÂÃæµÄÏÂÀ¿òÀïÃæÑ¡Ôñ“ <н¨...>”
6¡¢ÔÚµ¯³öµÄ¶Ô»°¿òÀïÃæ£¬ÊäÈëMyLib¡£¡£»òÕßËæ±ãÈ¡¸öÃû×Ö
È¥µôʹÓÃÃÜÂë±£»¤ÎļþµÄÑ¡Ïî
7¡¢¿ªÊ¼±àÂ룬ÈκÎÒ»¸ö¹«¿ªµÄÀ࣬±ØÐëÓÐÒ»¸ö I¿ªÍ¨µÄ½Ó¿Ú¶¨Òå
C# code
using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.InteropServices;
namespace MyLib
{
[ComVisible(true)]
[Guid("2CBD3D76-35F1-4f9d-9C1B-9DBFEE412F76")]
public interface IMyClass
{
void Initialize();
void Dispose();
int Add(int x, int y);
}
[ComVisible(true)]
[Guid("EA2F140A-108F-47ae-BBD5-83EEE646CC0D")]
[ProgId("MyLib.MyClass")]
public class MyClass : IMyClass
{
public void Initialize()
{
//nothing todo
}
public void Dispose()
{
//nothing todo
}
public int Add(int x, int y)
&
Ïà¹ØÎĵµ£º
1.Response.Redirect("http://www.jb51.net",false);
Ä¿±êÒ³ÃæºÍÔÒ³Ãæ¿ÉÒÔÔÚ2¸ö·þÎñÆ÷ÉÏ£¬¿ÉÊäÈëÍøÖ·»òÏà¶Ô·¾¶¡£ºóÃæµÄboolֵΪÊÇ·ñÍ£Ö¹Ö´Ðе±Ç°Ò³¡£
Ìø×ªÏòеÄÒ³Ãæ£¬Ô´°¿Ú±»´úÌæ¡£"
ä¯ÀÀÆ÷ÖеÄURLΪз¾¶¡£
:Response.Redirect·½·¨µ¼ÖÂä¯ÀÀÆ÷Á´½Óµ½Ò»¸öÖ¸¶¨µÄURL¡£µ±Response.Redirect()·½·¨± ......
дcookie
¡¡¡¡1 HttpCookie cookie = new HttpCookie("Info");//¶¨Òåcookie¶ÔÏóÒÔ¼°ÃûΪInfoµÄÏî
¡¡¡¡2 DateTime dt = DateTime.Now;//¶¨Òåʱ¼ä¶ÔÏó
¡¡¡¡3 TimeSpan ts=new TimeSpan(1,0,0,0);//cookieÓÐЧ×÷ÓÃʱ¼ä£¬¾ßÌå²émsdn
¡¡¡¡4 cookie.Expires = dt.Add(ts);//Ìí¼Ó×÷ÓÃʱ¼ä
¡¡¡¡5 cookie.Values.Add("user","cx ......
½ñÌìÔÚVS2005µ÷ÊÔÒ»¸öC# C/S³ÌÐò£¬µ±Í¨¹ýRFCÓëSAPÁ¬½Óʱ¼ä¹ý³¤Ê±£¬³öÏÖ´Ë´íÎó£¬ÔÚÍøÉÏÕÒµ½½â¾ö°ì·¨¡£
VS2008ÉϵÄÒ»¸ö³ÌÐò£¬Í¨¹ýOracle.DataAccess.dllÖ´ÐÐdrop user
cascade²Ù×÷£¬ÎÒÔÚsqlplusÖ´Ðд˲Ù×÷´óÔ¼ÐèÒªÒ»·ÖÖÓ×óÓÒʱ¼ä£¬µ±ÎÒÔÚVS2008ÖÐdebugÆô¶¯´Ë³ÌÐòʱ£¬Ò»Ö±½ÓÊÕµ½
“ContextSwitchDeadlock is detected& ......
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Data.SqlClient; ......
---------------------------------------
Asp.Net,C#,SQL,JS,WCF,AJAX,¹¤×÷Á÷,WPF,MVC,LINQ,Éè¼ÆÄ£Ê½(¼Ü¹¹)µÈ¼¼ÊõÌÖÂÛ
“ASP.NET(C#)Fans” QQȺ£º96877690
---------------------------------------
²»¹ÜÊÇJ2SE¡¢J2EE»¹ÊÇJ2ME¾´Çë¼ÓÈ룡Eclipse¡¢NetBeans
Java½»Á÷QQ¸ß¼¶ÈºÀ©ÕУº96878255 ......