Hi,
I am using a Script task and http Connection manager to get a zipfile from some websites.
My code is working fine for the sites which doesn't need username and password to be passed.
Can you help me modify my code so that I can pass username and password also.
FYI..
Below is the code I am using.
I am using the DownloadURL in the ReadOnlyVariables to pass my URL.
I also have my Username and Password Variables created.
public void Main()
{
// TODO: Add your code here
bool fireAgain = true;
Dts.Events.FireInformation(0, "Download File", "Start downloading " + Dts.Variables["DownloadURL"].Value.ToString(), string.Empty, 0,ref fireAgain);
// Create a webclient to download a file
WebClient mySSISWebClient = new WebClient();
//Download file and use the Flat File Connectionstring
// to save the file (and replace the existing file)
mySSISWebClient.DownloadFile(
// Logging end of download
Dts.Events.FireInformation(0, "Download
File", "Finished
downloading " + Dts.Connections["
// Quit Script Task succesful
Dts.TaskResult = (int)ScriptResults.Success;
//Dts.TaskResult = (int)ScriptResults.Success;
mySSISWebClient.DownloadFile
}