0
public static byte[] BBStorageGetFile(string filePath, int projectId)
{
var queryString = QueryStringEncoder.bbs_encode("a=g&p=" + filePath + "&s=" + projectId);
var url = "http://www.buildbinder.com/base/storageFile.aspx?" + queryString;
string urlB = HttpContext.Current.Request.Url.ToString();
if (urlB.Contains("intranet.buildbinder.com"))
{
url = "http://intranet.buildbinder.com:8000/base/storageFile.aspx?" + queryString;
}
Uri uri = new Uri(url);
WebClient webClient = new WebClient();
webClient.Credentials = CredentialCache.DefaultCredentials;
webClient.UseDefaultCredentials = true;
webClient.Headers.Add(HttpRequestHeader.Cookie, "culture");
webClient.Headers.Add(HttpRequestHeader.Cookie, "mySession");
webClient.Headers.Add(HttpRequestHeader.ContentType, "application/x-www-form-urlencoded");
webClient.Headers.Add(HttpRequestHeader.UserAgent, "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; .NET CLR 1.0.3705;)");
byte[] file = webClient.DownloadData(uri);
return file;
}
요청 헤더를 사용하여 세션 값이있는 쿠키를 보내는 것처럼 보이지만 쿠키 값을 가져 오거나 설정하는 위치가 표시되지 않습니다. –
무엇이 문제입니까? – Suhas
쿠키가 인식되지 않습니다. , 다운로드를위한 세션 정보를 포함합니다 –