Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 546953
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T10:55:16+00:00 2026-05-13T10:55:16+00:00

attrval[5] = WrmService.WindowsAgent.AgentVersion; From above if attrval[5] is null or not getting any value

  • 0
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

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T10:55:17+00:00Added an answer on May 13, 2026 at 10:55 am

    Try

    if(!int.TryParse(WrmService.WindowsAgent.AgentVersion, out attrval[5])) attrval[5] = 0;
    

    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:

    attrval[5] = string.IsNullOrEmpty(WrmService.WindowsAgent.AgentVersion) ? "0.0.0.0" : WrmService.WindowsAgent.AgentVersion;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When getting values out of xml attributes, using the xquery value operator, missing attributes
I have the following problem: I would like to change value of ExpandableListView's cell
I have this simple jQuery code $(document).ready(function() { $('#test').attr('value','hello world'); $('#test1').text('hello world'); }); And
I have an SQLite DB with one table that holds IDs for several strings,
ancestor::foo[bar[@attr=val]] I thought this would work, but it's not. I need to find the
I am trying to work out how to do something if a certain text
Consider that i have the string, $string = 'tag2 display=users limit=5'; Using the preg_match_all
I have read some post about fetch=join - http://nhforge.org/blogs/nhibernate/archive/2009/04/09/nhibernate-mapping-lt-many-to-one-gt.aspx (ser4ik.livejournal.com/2505.html) So I have some
I've got problem sending an array of string as parameter to a web service
I'd like something like this: each[i_, {1,2,3}, Print[i] ] Or, more generally, to destructure

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.