Community discussions

MikroTik App
 
David1234
Forum Guru
Forum Guru
Topic Author
Posts: 1424
Joined: Sun Sep 18, 2011 7:00 pm

API only change the first change of changs

Wed Jan 11, 2017 3:41 pm

is there something I need to erite after I'm using "set" ?

this is what I have - but it only change me the identity and not the ssid
 Console.WriteLine("Change System Identity -  ");
            mikrotik.Send("/system/identity/set");  
            mikrotik.Send("=name=DavidTest21211",true);
           // mikrotik.Send("/cancel");// to shut down to connection - exit from api -NOT IN USE 

            Console.WriteLine("****************************************************************** ");
            mikrotik.Send("/interface/wireless/print");
            mikrotik.Send("=.proplist=.id", true);
            string WlanSSID_Full= mikrotik.Read()[0];  //give me just the answer !re=.id=*D 
            string Wlan_Short=WlanSSID_Full.Substring(8);  // save only *D
            Console.WriteLine("this is jsut the ID of the wireless - " + Wlan_Short);
            Console.WriteLine("Change Wireless SSID -  ");
            mikrotik.Send("/interface/wireless/set");
            mikrotik.Send("=.id=" + Wlan_Short);
            mikrotik.Send("=ssid=dsaasd43hrts", true);
            Console.WriteLine("****************************************************************** ")
and I cancel the change of the identity it change me the SSID - so the commands are good , it's only something in the end of changes what I think



** update
I have notich that after i run the "set" command , if i run
foreach (string h in mikrotik.Read())
then it works
so i need to clear the response of the router , right?

Thanks ,

Who is online

Users browsing this forum: No registered users and 28 guests