I have a script task inside a SSIS package, like this,
public ReadListItemsSPOnline(string siteUrl, string email, string password, int requestTimeout)
{
_clientContext = new ClientContext(siteUrl);
var securePassword = new SecureString();
foreach (char c in password) securePassword.AppendChar(c);
String[] BypssArr = { "XXXXXX$" };
myProxy = new System.Net.WebProxy();
**myProxy.Address = new Uri("http://abc-proxy-in.abc.net:2020");**
myProxy.UseDefaultCredentials = true;
myProxy.BypassList = BypssArr;
System.Net.WebRequest.DefaultWebProxy = myProxy;
_clientContext.ExecutingWebRequest += (s, e) =>
{
//e.WebRequestExecutor.WebRequest.Headers.Add("X-FORMS_BASED_AUTH_ACCEPTED", "f");
e.WebRequestExecutor.WebRequest.Proxy.Credentials = System.Net.CredentialCache.DefaultCredentials;
};
_clientContext.Credentials = new SharePointOnlineCredentials(email, securePassword);
_clientContext.RequestTimeout = requestTimeout;
_clientContext.Load(_clientContext.Web);
_clientContext.ExecuteQuery();
}
As you can see proxy server is hard coded http://abc-proxy-in.abc.net:2020.I want to make the proxy address configurable.I have added a package parameter($project::Proxy_Name) inside my package and I want to use this parameter inside the script task to make it more configurable. Can you let me know what changes should I make in this code to make it more configurable,as I am not a .net person.