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

推荐订阅源

月光博客
月光博客
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
阮一峰的网络日志
阮一峰的网络日志
罗磊的独立博客
T
Tailwind CSS Blog
博客园_首页
博客园 - 司徒正美
Google DeepMind News
Google DeepMind News
Hugging Face - Blog
Hugging Face - Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
V
V2EX
J
Java Code Geeks
量子位
D
DataBreaches.Net
MongoDB | Blog
MongoDB | Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Microsoft Azure Blog
Microsoft Azure Blog
P
Proofpoint News Feed
C
Check Point Blog
V
Visual Studio Blog
H
Help Net Security
Recent Announcements
Recent Announcements
Engineering at Meta
Engineering at Meta

博客园 - 启明星工作室

高等数学在线入门教程(零基础适配) Latex安装Texlive Authenticate an EWS application by using OAuth codemirror 高等数学课件 线性代数课件 概率论与数理统计课件 使用 Microsoft Graph oFFICE365 sendmail C# C# String 字符串转换为base64 C#语言async, await 简单介绍与实例(入门级) Microsoft.Exchange.WebServices.Data; 启明星工作室网站改版了 dotnetcms.cn 数学题库管理系统 Math 面向老师的单机版“数学系统math” 启明星Helpdesk系统,欢迎大家使用。 启明星人物评选投票系统,欢迎大家使用 微信安装包从0.5M暴涨到260M,为什么我们的程序越来越大? Kmath里MathJax和markdown整合 Windows下TeXLive 环境的安装与配置
MathPix
启明星工作室 · 2022-03-15 · via 博客园 - 启明星工作室
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Text;
using System.Net;
using System.IO;
public partial class _Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
       
    }

    protected void Button1_Click(object sender, EventArgs e)
    {
        string appid = "983506039_qq_com_962b1aefc";
        string appkey = "2e0b9a8a2f357d2f2901055b290c185ad56196e714bb127d4a09e4b81b7c";

       // string jsonHeard = "{\"app_id\": \""+ appid+"\", \"app_key\": \""+ appkey+"\"}";
        string url = "https://api.mathpix.com/v3/text";

        HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(url);
        request.Method = "POST";
        request.ContentType = "application/json"; 
        request.Headers.Set("app_id", appid);
        request.Headers.Set("app_key", appkey);

        string body = "{ \"src\":\"https://mathpix-ocr-examples.s3.amazonaws.com/cases_hw.jpg\", \"math_inline_delimiters\": [\"$\", \"$\"],  \"rm_spaces\": True}";

        body = "{ \"src\":\"http://www.dotnetcms.cn/1.png\", \"math_inline_delimiters\": [\"$\", \"$\"], \"math_display_delimiters\": [\"$$\", \"$$\"], \"rm_spaces\": \"true\"}";



        byte[] postBytes = null;
        postBytes = Encoding.UTF8.GetBytes(body);
        request.ContentLength = postBytes.Length;

        using (Stream reqStream = request.GetRequestStream())
        {
            reqStream.Write(postBytes, 0, postBytes.Length);
        }

        string result = string.Empty;

        using (WebResponse response = request.GetResponse())
        {
            if (response != null)
            {
                using (Stream stream = response.GetResponseStream())
                {
                    using (StreamReader reader = new StreamReader(stream, Encoding.UTF8))
                    {
                        result = reader.ReadToEnd();
                    }
                }

            }
        }

        Response.Write(result);

    }
}