Example #1
0
    public string UpLoadWeChatNewsXMLurl()
    {
        string token = m_token;

        if (token == null)
        {
            return("");
        }
        if (!File.Exists(Application.streamingAssetsPath + "/WeChatNews.xml"))
        {
            return("");
        }
        string xml        = File.ReadAllText(Application.streamingAssetsPath + "/WeChatNews.xml");
        string encodedXml = xml.Replace("&", "&amp;");/*.Replace("<", "&lt;").Replace(">", "&gt;").Replace("\"", "&quot;").Replace("'", "&apos;");*/

        File.Delete(Application.streamingAssetsPath + "/WeChatNews.xml");
        File.WriteAllText(Application.streamingAssetsPath + "/WeChatNews.xml", encodedXml);

        Encoding encoding = Encoding.UTF8;
        IDictionary <string, string> parameters = new Dictionary <string, string>();

        parameters.Add("name", "WeChatNews.xml");
        string retString = HttpWebResponseUtility.Upload_Request(PriceUrl, parameters, encoding, Application.streamingAssetsPath + "/WeChatNews.xml", "WeChatNews.xml", token);

        return(retString);
    }
Example #2
0
    public string UpLoadXml()
    {
        string token = m_token;

        if (token == null)
        {
            return("");
        }
        Encoding encoding = Encoding.UTF8;
        IDictionary <string, string> parameters = new Dictionary <string, string>();

        parameters.Add("name", "discountsInfo.xml");
        string retString = HttpWebResponseUtility.Upload_Request(PriceUrl, parameters, encoding, Application.streamingAssetsPath + "/discountsInfo.xml", "discountsInfo.xml", token);

        return(retString);
    }