people with nt,
i have been trying for a number of weeks now to get nt to generate text files as logs for events of interest. i received very little assistance from nt support but i have continued to work hard on this objective and have been able to make good progress. actually, i have been watching videos and going though microsoft's courses to learn to code in c# and it has been very helpful for this matter.
at this point i have been able to get streamwriter to work acceptably in nt.
[INDENT]private void recordevent ( string filepath ) [/INDENT][INDENT]{[/INDENT][INDENT] [/INDENT][INDENT=2]filepath = string.Format(@"{0}ntlogs {1} {2} {3} {4} {5}.txt", Pridir, Symtic, DateTime.Now.ToString("yyyyMMdd HHmmss"), Castyp, Close[0]);[/INDENT][INDENT=2] Print(filepath); sw = new StreamWriter(filepath); sw.AutoFlush = true; sw.WriteLine(message); sw.Close(); [/INDENT][INDENT]}[/INDENT]
from everything i have studied, it seems to me that nt implicitly converts the number Close[0] to string in the fragment above as it has been working correctly for me.
however, there are several other numerical inputs and variables (some are integer, some are decimal type) i want to be able to print to my text files using this same string.Format(@"...", method. in these cases, implicit conversion by c# will not be good enough. ¿how can i command nt to convert decimal or integer values to string? ¿and very importantly, how can i define the number of decimals that will be printed? ¿and, is it possible to define the number of decimals to be printed as a user defined input instead of hard coding it?
very well, i hope i will receive far more effective assistance from nt support this time. thanks, regards.
Comment