C# Active¿Ø¼þ£¬²¢´¥·¢javascriptʼþ
´´½¨Ò»¸öWinformÓû§¿Ø¼þ UserControl1
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;
using System.Runtime.InteropServices;
using System.Reflection;
namespace MyActiveTest
{
[ComVisible(true)]
[ClassInterface(ClassInterfaceType.AutoDual)]
[ComSourceInterfaces(typeof(UserControl1Events))]
[Guid("B0CF6712-4798-424d-8D08-A1E1E2F53B74")]
public partial class UserControl1 : UserControl, IObjectSafety
{
public delegate void SubmitClickedHandler();
public event SubmitClickedHandler SubmitClicked;
public UserControl1()
{
InitializeComponent();
}
//
private string _mymessage;
public string Mymessage
{
get { return _mymessage; }
set { _mymessage = value; }
}
string _param = "http://www.163.com";
public string Param
{
get
{
return _param;
}
set
{
_param = value;
}
}
private void button1_Click(object sender, EventArgs e)
{
MessageBox.Show(_mymessage);
if (SubmitClicked != null)
// _param = "ÕâÊÇÒ»¸ö²âÊÔµÄÎļþ";
SubmitClicked();
}
public void ttMessageBox()
{
MessageBox.Show("sdsdfsd");
}
#region IObjectSafety ³ÉÔ±
public void GetInterfacceSafyOptions(int riid, out int pdwSupportedOptions, out int pdwEnabledOptions)
{
pdwSupportedOptions = 1;
pdwEnabledOptions = 2;
}
public void SetInterfaceSafetyOptions(int riid, int dwOptionsSetMask, int dwEnabledOptions)
{
//throw new Exception("The method or operation is not imple
Ïà¹ØÎĵµ£º
Õâ¸öµØ·½¾ÍÊÇΪʲôËüµÄStringÀàÐͲ»Ö±½ÓÌṩһ¸ötrim·½·¨ÄØ£¿
Ϊʲôÿ´Î¶¼ÒªÐ´ÕâÑùÒ»¾ä»°ÄØ£¿
String.prototype.trim=function(){return this.replace(/(^\s*)|(\s*$)/g,"");}
ÕâÑùÓÐÒâ˼Âð£¿
JavaScriptÖй涨һ¸öÕâÑùµÄ·½·¨»áËÀ°¡£¿ ......
¶¨Òå·½·¨£º
1¡¢Óù¹Ô캯ÊýRegExp
2¡¢Ö±½ÓÁ¿£¬°üº¬ÔÚÒ»¶Ô£¨/£©Ö®¼äµÄ×Ö·û
Ö±½ÓÁ¿×Ö·û£º
×ÖĸÊý×Ö×Ö·û——×ÔÉí
\o——NULL×Ö·û
\t——ÖÆ±í·û
\n——»»Ðзû
\v——´¹Ö±ÖƱí·û
\f——»»Ò³·û
\r——»Ø³µ·û ......
ѧºÃASP.NET£¬JavaScriptÏàµ±ÖØÒª£¬Ç°Ò»¶Îʱ¼ä¿´ÍêÁË¡¶JavaScript»ù´¡½Ì³Ì¡·£¨ÁîÈËÓôÃÆµÄÊÇ£¬ÔÚÎÒÂò»Ø¼ÒµÚÁù°æÖ®ºó£¬µÚÆß°æÆäʵÒѾÓÐÁË£©¡£ºÃ¾Ãû¸´Ï°ÁË£¬¼ÓÉÏÆ½Ê±Ñ§Ï°ºÍ¹¤×÷Éæ¼°JavaScriptµÄ²¢²»¶à£¬ËùÒÔÓÐЩ¶¼µÍüÁË¡£½ñÌìϰàÍæÁË»áwow£¬Äóöµãʱ¼ä¸´Ï°Ï£¬ÕûÀíÕûÀíһЩÈÝÒ×Íü¼ÇµÄ֪ʶµã¡£ÀÍÒݽáºÏ£ ......
<SCRIPT LANGUAGE="JavaScript">
var strDate1 = "2003-06-17";
var strDate2 = "2004-09-18";
//var strDate1 = "2003-06-17 03:03:40.0";
//var strDate2 = "2004-09-18 12:03:12.0" ......