예제 #1
0
파일: Form1.cs 프로젝트: rocketeerbkw/DNA
        private string OldUploadFile(string filename, string response, Uri skinUploadServerURL, NameValueCollection queryString)
        {
            CookieAwareWebClient Client = new CookieAwareWebClient();
            NetworkCredential myCred = new NetworkCredential("editor", _editorPassword);
            CredentialCache MyCrendentialCache = new CredentialCache();
            MyCrendentialCache.Add(skinUploadServerURL, "Basic", myCred);
            Client.Credentials = MyCrendentialCache;
            if (_proxy != String.Empty)
            {
                Client.Proxy = new WebProxy("http://" + _proxy + ":" + _port);
            }
            Client.Cookies = _cookieContainer;

            Client.Headers.Add(HttpRequestHeader.ContentType, "text/xml");


            Client.QueryString.Add("skinstubpath", queryString["skinstubpath"]);
            Client.QueryString.Add("skinname", queryString["skinname"]);
            Client.QueryString.Add("skin", queryString["skin"]);

            byte[] responseArray = Client.UploadFile(skinUploadServerURL, filename);

            response = System.Text.Encoding.ASCII.GetString(responseArray);
            return response;
        }