小编use*_*021的帖子

谷歌拼写检查 API

有人知道吗?我通过了拼写检查“accelerants”,这是一个非常好的词。我回来“加速”?当我在浏览器中打开 Google 并输入“accelerants”时,它不建议“accelerates”?

using System;
using System.Net;
using System.Text;
using System.Text.RegularExpressions;

namespace SpellCheck
{
    class googel_SP
    {
        public string word;
        public void run_G()
        {
            string retValue = string.Empty;
            string Iword = "accelerants";

            try
            {
                string uri = "https://www.google.com/tbproxy/spell?lang=en:";
                using (WebClient webclient = new WebClient())
                {
                    string postData = string.Format("<?xml version=\"1.0\"     encoding=\"utf-8\" ?> " 
                    + "<spellrequest textalreadyclipped=\"0\" ignoredups=\"0\"     ignoredigits=\"1\" "
                    + "ignoreallcaps=\"1\"><text>{0}</text></spellrequest>", Iword);

                    webclient.Headers.Add("Content-Type", "application/x-www-form-    urlencoded");
                    byte[] bytes = Encoding.ASCII.GetBytes(postData);
                    byte[] response = webclient.UploadData(uri, "POST", bytes);
                    string data = Encoding.ASCII.GetString(response);
                    if …
Run Code Online (Sandbox Code Playgroud)

c# asp.net

5
推荐指数
1
解决办法
9014
查看次数

标签 统计

asp.net ×1

c# ×1