Forum Discussion
David_Los_23059
Nimbostratus
Jul 26, 2006Problems with an If Statement
Hello,
I have been working on a C console application and I am having problems with an if statement that is trying to check the LocalLB.EnabledStatus.
The line of code that I am using looks like
if (new_obj_members[j][k].object_status.enabled_status == PoolMember.LocalLBEnabledStatus.ENABLED_STATUS_ENABLED)
//Just using this to test
Console.Write("this is enabled");
This is giving me the error: 'PoolMember.LocalLBPoolMember' does not contain a definition for 'LocalLBEnabledStatus'
I also tried with this
if (new_obj_members[j][k].object_status.enabled_status == LocalLBEnabledStatus.ENABLED_STATUS_ENABLED)
//Just using this to test
Console.Write("this is enabled");
This is giving the error: Operator '==' cannot be applied to operands of type 'PoolMember.LocalLBEnabledStatus' and 'Pool.LocalLBEnabledStatus'
- Can you post the type of your new_obj_members variable? Is this the return from LocalLB::PoolMember::get_object_status()?
Private LocalLBPoolMember PoolMember = new LocalLBPoolMember();
private LocalLBPoolMember m_poolMember = new LocalLBPoolMember()
- David_Los_23059
Nimbostratus
Sorry about not posting the entire code. I didnt know how much I should post on here. Below is what I currently have in that area of the code.private LocalLBPool Pool = new LocalLBPool(); private LocalLBPoolMember PoolMember = new LocalLBPoolMember();
void getPoolInfo(string[] pool_list) { //Get the Current Active Member Count long[] cur_active_member_list = Pool.get_active_member_count(pool_list); //Gets the Member Objects - Status and Enabled State LocalLBPoolMemberMemberObjectStatus[][] new_obj_members = PoolMember.get_object_status(pool_list); // Output the Active Member Count for (int i = 0; i < pool_list.Length; i++) { Console.WriteLine("Current Active Members: " + cur_active_member_list); } //Output the IP and Enabled State for (int j = 0; j < new_obj_members.GetLength(0); j++) { for (int k = 0; k < new_obj_members[j].GetLength(0); k++) { Console.WriteLine("IP Number: " + new_obj_members[j][k].member.address + " " + new_obj_members[j][k].object_status.availability_status); Console.Write("this is enabled"); } }
- David_Los_23059
Nimbostratus
Thanks for the help! Yes I was following your documentation. Maybe I can finish up this application today. Thanks!
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects