How do I get the default constructor value in a function
- by lax
public class AppXmlLogWritter
{
public int randomNumber;
public string LogDateTime = "";
public AppXmlLogWritter()
{
Random random = new Random();
randomNumber = random.Next(9999);
LogDateTime = DateTime.Now.ToString("yyyyMMdd HHmmss");
}
public AppXmlLogWritter(int intLogIDPrefix, string strLogApplication, string strLogFilePath)
{
LogIDPrefix = intLogIDPrefix;
LogApplication = strLogApplication;
LogFilePath = strLogFilePath;
}
public void WriteXmlLog(string LogFlag)
{
string value=LogDateTime + randomNumber;**//Here i m getting 0 no date time and random number generated**
}
}
AppXmlLogWritter objParameterized = new AppXmlLogWritter(1234, "LogApplication", "LogFilepath");
AppXmlLogWritter objParmeterlessConstr = new AppXmlLogWritter();
objParameterized.WriteXmlLog("0", "LogFlag");
How do I get the default constructor value in this function?