script task sssis file extension is missing? Hi I have problem with script task C# I create I have to prefix log file with date but my problem is not adding file extension 
log file is log_yyyy_MM_dd without extension
I want ti extension
log file is log_yyyy_MM_dd.txt or CSV

    private string ReadVariable(string varName)
    {
        object rtnValue = null;
        Variables var = default(Variables);
        try
        {
            Dts.VariableDispenser.LockOneForRead(varName, ref var);
            rtnValue = var[varName].Value.ToString();
        }
        catch (Exception ex)
        {
            throw ex;
        }
        finally
        {
            var.Unlock();
        }
        return rtnValue.ToString();
    }


    private void WriteVariable(string varName, object value)
    {
        Variables var = default(Variables);
        try
        {
            Dts.VariableDispenser.LockOneForWrite(varName, ref var);
            var[varName].Value = value;
        }
        catch (Exception ex)
        {
            throw ex;
        }
        finally
        {
            var.Unlock();
        }
    }

    public void Main()
    {
        //Read Variables
        String sFlatFileConnection = ReadVariable("FlatFileConnection");



        //Get Run Date
        DateTime dtRunDate = DateTime.Now;

        sFlatFileConnection = sFlatFileConnection + dtRunDate.ToString("yyyy_MM_dd");
        WriteVariable("FlatFileConnection", sFlatFileConnection);

        Dts.TaskResult = (int)ScriptResults.Success;
    }
}
Have you tried just adding the extension to the variable like this?

sFlatFileConnection = sFlatFileConnection + dtRunDate.ToString("yyyy_MM_dd") + '.txt';