惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Attack and Defense Labs
Attack and Defense Labs
The GitHub Blog
The GitHub Blog
C
Check Point Blog
博客园_首页
MongoDB | Blog
MongoDB | Blog
N
Netflix TechBlog - Medium
F
Full Disclosure
Microsoft Security Blog
Microsoft Security Blog
爱范儿
爱范儿
Recent Announcements
Recent Announcements
阮一峰的网络日志
阮一峰的网络日志
G
GRAHAM CLULEY
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
T
Threat Research - Cisco Blogs
C
Cybersecurity and Infrastructure Security Agency CISA
V
Vulnerabilities – Threatpost
K
Kaspersky official blog
博客园 - 司徒正美
S
Schneier on Security
T
The Exploit Database - CXSecurity.com
Project Zero
Project Zero
云风的 BLOG
云风的 BLOG
Cisco Talos Blog
Cisco Talos Blog
Know Your Adversary
Know Your Adversary
雷峰网
雷峰网
V
V2EX - 技术
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Spread Privacy
Spread Privacy
罗磊的独立博客
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
S
Security Affairs
SecWiki News
SecWiki News
Schneier on Security
Schneier on Security
O
OpenAI News
Jina AI
Jina AI
PCI Perspectives
PCI Perspectives
Cyberwarzone
Cyberwarzone
Y
Y Combinator Blog
Apple Machine Learning Research
Apple Machine Learning Research
B
Blog RSS Feed
I
InfoQ
D
Docker
P
Palo Alto Networks Blog
Recorded Future
Recorded Future
M
MIT News - Artificial intelligence
博客园 - Franky
B
Blog
Scott Helme
Scott Helme
博客园 - 叶小钗
D
DataBreaches.Net

博客园 - Ivan Zou

示例 - 17行代码实现一个简单高效的多线程蜘蛛程序 示例 - 10行代码在C#中获取页面元素布局信息 Spider Studio 新版本 (20140225) - 设置菜单调整 / 提供JQueryContext布局相关的方法 示例 - 如何在NodeJS中调用SS生成的DLL 示例 - 25行代码等价实现 - 借助Nodejs在服务端使用jQuery采集17173游戏排行信息 Spider Studio 新版本 (码年吉祥版) - 浏览器视图 / 脚本库上线! 分享: 利用Readability解决网页正文提取问题 分享一个天气历史数据的采集脚本 分享 - Hybrid 开发将博客园集成到自己的网站中 - 效果高大上 :) Spider Studio 新版本 (20140109) - 修复浏览器对部分网页不支持的BUG Spider Studio 新版本 (20140108) - 优化设置菜单 / 生成程序集支持版本号 示例 - 数据仓库的妙用 Spider Studio 界面功能布局 C# 脚本代码自动登录淘宝获取用户信息 API - 使用数据仓库 - 基础篇 示例 - 如何在多线程中应用SpiderStudio生成的DLL? 示例 - 如何在Console应用程序中应用SpiderStudio生成的DLL? C#中另辟蹊径解决JSON / XML互转的问题 Spider Studio 新版本 (x-mas) - 可以引入第三方程序集, 可以将脚本生成为DLL
示例 - 如何在ASP.NET中应用Spider Studio生成的DLL?
Ivan Zou · 2013-12-26 · via 博客园 - Ivan Zou

>> 接前文 "示例 - 如何在Console应用程序中应用SpiderStudio生成的DLL?", 将其运用到ASP.NET中:

1. 创建WebApplication项目, 引入www.utilities_online.info.XmlJsonConverter.dll

2. 设置Target Framework为: .NET Framework 4

3. 在Default.aspx上拖放控件

HTML:

<%@ Page Title="Home Page" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true"
    CodeBehind="Default.aspx.cs" Inherits="WebApplication1._Default" AspCompat="true" %>

<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
</asp:Content>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
    <table>
    <tr><td>XML</td><td></td><td>JSON</td></tr>
        <tr>
            <td>
                <input id="xml" style="width:445px;height:320px" type="text" runat=server/>
            </td>
            <td>
                <asp:Button ID="toxml" runat="server" Text="&lt;-" onclick="toxml_Click" />
                <br />
                <asp:Button ID="tojson" runat="server" Text="-&gt;" onclick="tojson_Click" />
            </td>
            <td>
                <input id="json" style="width:445px;height:320px"  type="text" runat=server />
            </td>
        </tr>
    </table>
</asp:Content>

4. 将Default.aspx设置为: AspCompat="true"

<%@ Page Title="Home Page" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true"
    CodeBehind="Default.aspx.cs" Inherits="WebApplication1._Default" AspCompat="true" %>

- 这样做的目的是将页面的线程模型改成单线程模式, 从而能够支持activeX控件的调用. 

5. 编写后台代码

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using www.utilities_online.info;

namespace WebApplication1
{
    public partial class _Default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
        }

        protected void toxml_Click(object sender, EventArgs e)
        {
            xml.Value = new XmlJsonConverter().Json2Xml(json.Value);
        }

        protected void tojson_Click(object sender, EventArgs e)
        {
            json.Value = new XmlJsonConverter().Xml2Json(xml.Value);
        }
    }
}

6. 运行~!

相关阅读: