[C#] 纯文本查看 复制代码 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.IO;
using System.Web.UI;
using System.Web.UI.WebControls;
using CsharpHttpHelper;
using System.Runtime.InteropServices;
namespace JStest
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
HttpJs_Demo hjd = new HttpJs_Demo();
string s = hjd.javamain1();
}
}
public partial class HttpJs_Demo : System.Web.UI.Page
{
public string javamain1()
{
string strjs = string.Empty;
using (StreamReader sr = new StreamReader(Server.MapPath("test.js")))
{
strjs = sr.ReadToEnd();
}
string main1 = HttpHelper.JavaScriptEval(strjs, "main1()");
return main1;
}
}
}
提示是:未将对象引用设置到对象的实例。 我该如何使用更为恰当呢?
|