事件触发问题
我写了一小程序,想在程序一启动就触发按钮事件,要怎么做到?我尝试在mian()声明窗体frmEmulateLoginLookup 的变量,想通过窗体变量带出事件,但事实上是不行的。
下面是窗体frmEmulateLoginLookup 的具体代码
[code=csharp]using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Web;
using System.Net;
using System.IO;
using System.Text.RegularExpressions;
namespace sample_1
{
public partial class frmEmulateLoginLookup : Form
{
CookieCollection curCookies = null;
public frmEmulateLoginLookup()
{
InitializeComponent();
}
/// <summary>
/// post data
/// </summary>
/// <param name="paras"></param>
/// <returns></returns>
public string quoteParas(Dictionary<string, string> paras)
{
string quotedParas = "";
bool isFirst = true;
string val = "";
foreach (string para in paras.Keys)
{
if (paras.TryGetValue(para, out val))
{
if (isFirst)
{
isFirst = false;
quotedParas += para + "=" + HttpUtility.UrlPathEncode(val);
}
else
{
quotedParas += "&" + para + "=" + HttpUtility.UrlPathEncode(val);
&nbs