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

推荐订阅源

The GitHub Blog
The GitHub Blog
I
InfoQ
U
Unit 42
WordPress大学
WordPress大学
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Apple Machine Learning Research
Apple Machine Learning Research
J
Java Code Geeks
月光博客
月光博客
D
Docker
Stack Overflow Blog
Stack Overflow Blog
D
DataBreaches.Net
阮一峰的网络日志
阮一峰的网络日志
Blog — PlanetScale
Blog — PlanetScale
V
Visual Studio Blog
博客园 - 聂微东
A
About on SuperTechFans
腾讯CDC
Jina AI
Jina AI
Microsoft Azure Blog
Microsoft Azure Blog
GbyAI
GbyAI
博客园 - 【当耐特】
罗磊的独立博客
博客园 - 三生石上(FineUI控件)
M
MIT News - Artificial intelligence

博客园 - 启明星工作室

高等数学在线入门教程(零基础适配) 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);

    }
}