attrval[5] = WrmService.WindowsAgent.AgentVersion;
From above if attrval[5] is null or not getting any value or any strings other than numeric values I want to assign attrval[5] to value ‘0.0.0.0’ otherwise I will
display the numeric value which is coming.What coding i have to implement here
as per the information while doing googling I did this
attrval[5] = (WrmService.WindowsAgent.AgentVersion == null || Microsoft.VisualBasic.Information.IsNumeric(WrmService.WindowsAgent.AgentVersion)) ?
"0.0.0.0" : WrmService.WindowsAgent.AgentVersion;
but Microsoft.VisualBasic.Information.IsNumeric making problems. Is there any similar one in C#?
only two outputs I required one will be numeric and one will be any other, it can be string or null whatever it i have to set in to 0.0.0.0
Try
In this case, if AgentVersion is numeric, it will place the parsed value into attrval[5], otherwise it will set it to 0.
edit
Ah I guess you are looking for: