组装成字符串再返回啊
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Runtime .InteropServices ;namespace WindowsApplication246
{
    [ComVisible (true )]
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();            WebBrowser WB = new WebBrowser();
            WB.Parent = this;
            WB.Dock = DockStyle.Fill;
            WB.DocumentText = "<input type='button' value='!!!!!' onclick='alert(window.external.X)'/>";            WB.ObjectForScripting = this;
        }        public struct S
        {
            public int A;
            public String B;
        }        public String X()
        {
            S s = new S();
            s.A = 1;
            s.B = "ZZZ";            return s.A.ToString() + ";" + s.B;   
        }
    }
}