title: SSIS ScriptTask change Value property of Variable
body: <p>I try to simply change value of SSIS variable doing this code in ScriptTask:</p>
  
  <pre><code>        string path = Dts.Connections["BazyPobrane"].ConnectionString.ToString();
          string[] nameZIParray = Directory.GetFiles(path, "*.ZIP");
          string[] nameRARarray = Directory.GetFiles(path, "*.RAR");
  
          foreach (string nameZIP in nameZIParray) //search new ZIP
          {
              if (File.GetCreationTime(nameZIP) &gt; DateTime.Now.AddDays(-1))
              {
                  Dts.Variables["User::NazwaPliku"].Value = Path.GetFileName(nameZIP);
              }
  
          }
          foreach (string nameRAR in nameRARarray) //search new RAR
          {
              if (File.GetCreationTime(nameRAR) &gt; DateTime.Now.AddDays(-1))
              {
                  Dts.Variables["User::NazwaPliku"].Value = Path.GetFileName(nameRAR);
              }
  
          }
          Dts.TaskResult = (int)ScriptResults.Success;
  </code></pre>
  
  <p>After executing ScriptTask it simply don't change the variable Value. Debug mode seems fine. Maybe i miss some component settings?
  Thx!</p>