public string[] GetAccessPointMacAddresses()
{
netshline = null;
while ((netshline = sr.ReadLine()) != null)
{
int BSSIDNumber = 0;
BSSIDNumber = Convert.ToInt32(netshline.IndexOf("BSSID" + 6));
string result1 = netshline.Substring(netshline.IndexOf(":") + 1);
return result1;
}
}
if i return result1 i am getting this error
Cannot implicitly convert type string to string[]
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.

Sanjeeb LenkaRank #301 · 8.3K reputationPosted Aug 17, 2013, 3:58 AM EDT
public string[] GetAccessPointMacAddresses()
{
List
netshline = null;
while ((netshline = sr.ReadLine()) != null)
{
int BSSIDNumber = 0;
BSSIDNumber = Convert.ToInt32(netshline.IndexOf("BSSID" + 6));
string result1 = netshline.Substring(netshline.IndexOf(":") + 1);
myCollection.Add(result1);
}
return myCollection.ToArray();
}
Iftikar HussainRank #423 · 5.9K reputationPosted Aug 17, 2013, 4:20 AM EDT
Change the return type from string[] to string
public string GetAccessPointMacAddresses()
{
netshline = null;
string result1="";
while ((netshline = sr.ReadLine()) != null)
{
int BSSIDNumber = 0;
BSSIDNumber = Convert.ToInt32(netshline.IndexOf("BSSID" + 6));
result1 = netshline.Substring(netshline.IndexOf(":") + 1);
}
return result1;
}
Regards,
Iftikar