在asp.net网站上获取返回的JSON(来自asp.net webservice)

时间:2017-08-08 15:36:41

标签: asp.net json web-services c#-4.0

我有以下Web服务,它负责读取文档并返回Json数据,

__sharethis__.initialize()

工作kool。现在我在我的网站内使用这个Web服务。 以下列方式。

public string HelloWorld(string FileNamePath)
    {
        object filename = FileNamePath;
        //Initiating Application Class
        Microsoft.Office.Interop.Word.ApplicationClass AC = new Microsoft.Office.Interop.Word.ApplicationClass();
        Microsoft.Office.Interop.Word.Document doc = new Microsoft.Office.Interop.Word.Document();
        object readOnly = false;
        object isVisible = true;
        object missing = System.Reflection.Missing.Value;
        //Reating the word document and adding it to textbox
        try
        {
            int line = File.ReadAllLines(FileNamePath).Count();
            doc = AC.Documents.Open(ref filename, ref missing, ref readOnly,
                ref missing, ref missing, ref missing, ref missing, ref missing,
                ref missing, ref missing, ref missing, ref isVisible);
            value = Regex.Replace(doc.Content.Text, @"[\r|\n|\t|\u0007]", "");
            return JsonConvert.SerializeObject(value, Newtonsoft.Json.Formatting.Indented);
        }
        catch (Exception ex)
        {
            throw ex;
        }    

    }

但我如何打印我的意思是在我的网站上获取返回的JSON。 确定该服务正在返回JSON。

请帮我解决一下

0 个答案:

没有答案
相关问题