Community discussions

 
User avatar
danikf
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 62
Joined: Mon Mar 14, 2011 8:57 am

Re: C# API - tik4net on GitHub

Mon Oct 01, 2018 6:29 pm

of course ...
...
... if you are able to read previous posts ...
var user = new HotspotUser()
{
    Name = "TEST",
    LimitUptime = "1:00:00",
    Password = "secretpass"
};
_connection.Save(user);
 
User avatar
saputra19
just joined
Posts: 7
Joined: Fri Mar 23, 2018 3:11 pm
Location: indonesia
Contact:

Re: C# API - tik4net on GitHub

Thu Oct 04, 2018 12:48 pm

Version 3.4. released.

https://github.com/danikf/tik4net/releases/tag/v3.4

Whats new:
tool/traceroute entity + helpers
tool/ping helpers
Command.ExecuteWithDuration fix
InterfaceMonitorTraffic fix

D
great update!! thank you daniel.
now i have a small request.
can you add ip bindings object?

thank you very much
 
phamthinh2707
just joined
Posts: 5
Joined: Thu Sep 27, 2018 6:04 am

Re: C# API - tik4net on GitHub

Wed Oct 10, 2018 6:55 am

To make the setup process faster I writting c# Winforms Application base on you tik4net API call Mikrotik Controller right now.
When you reset no default the Mikrotik router(951Ui), it IP will become "0.0.0.0".
So there is no other way for me to configure the router via MAC address.
Any solution for me, thank you so much.
 
giguard
just joined
Posts: 13
Joined: Mon Oct 01, 2018 7:10 pm

Re: C# API - tik4net on GitHub

Thu Oct 11, 2018 4:59 pm

Hi,

I really need help on this bit of code.
            ITikCommand printcmd = connection.CreateCommand("/ip/ipsec/remote-peer/print");
            IEnumerable<ITikReSentence> userlist = printcmd.ExecuteList();
Running it will return Exception: 'no such command prefix'

What have I done wrong?
Thank you,

Daniel
 
nescafe2002
Member
Member
Posts: 448
Joined: Tue Aug 11, 2015 12:46 pm
Location: Netherlands

Re: C# API - tik4net on GitHub

Thu Oct 11, 2018 5:08 pm

/ip/ipsec/remote-peer is not valid.
/ip/ipsec/remote-peers is.
 
giguard
just joined
Posts: 13
Joined: Mon Oct 01, 2018 7:10 pm

Re: C# API - tik4net on GitHub

Thu Oct 11, 2018 5:34 pm

wow. Of all this time I ran that command without 's'.
Terminal is much more forgiving than API huh? :lol:

Feeling very silly now.
Thank you. You've been a GREAT help. :D
Thank you,

Daniel
 
User avatar
danikf
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 62
Joined: Mon Mar 14, 2011 8:57 am

Re: C# API - tik4net on GitHub

Thu Oct 11, 2018 6:03 pm

now i have a small request.
can you add ip bindings object?
Hi,
what are you meaning by "ip binding object". Is it different from IpAddress object?

D
 
User avatar
danikf
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 62
Joined: Mon Mar 14, 2011 8:57 am

Re: C# API - tik4net on GitHub

Thu Oct 11, 2018 6:06 pm

When you reset no default the Mikrotik router(951Ui), it IP will become "0.0.0.0".
So there is no other way for me to configure the router via MAC address.
Hi,
mac-telnet is complicated protocol - I have tried to find some libraries, but without success (.NET libraries :-) ). Not sure, but you can try to manage it by connection to neigbor router and use its mac-telnet function ....
Sorry, but I don't have any better solution ...
D
 
giguard
just joined
Posts: 13
Joined: Mon Oct 01, 2018 7:10 pm

Re: C# API - tik4net on GitHub

Thu Oct 11, 2018 6:25 pm

After that little incident with missing 's', I was humming along just fine.
However, while performing disconnection on one connection made by Android phone program failed and returned Exception.
See below.
Unhandled Exception: tik4net.TikSentenceException: Duplicit key 'port' with deffirent values '4500' vs. '59061'
at tik4net.Api.ApiSentence..ctor(IEnumerable`1 words)
at tik4net.Api.ApiConnection.ReadSentence()
at tik4net.Api.ApiConnection.GetOne(String tag)
at tik4net.Api.ApiConnection.<GetAll>d__60.MoveNext()
at System.Collections.Generic.List`1.AddEnumerable(IEnumerable`1 enumerable)
at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
at tik4net.Api.ApiConnection.CallCommandSync(String[] commandRows)
at tik4net.Api.ApiCommand.ExecuteSingleRow()
First line of the exception talks about 4500 vs 59061
It turns out 4500 is the local port and 59061 is the remote port.
See below.
[admin@<HOST>] > /ip ipsec remote-peers print detail
Flags: R - responder, N - natt-peer
0 RN id="blah" local-address=X.X.X.X port=4500
remote-address=Y.Y.Y.Y port=59061 state=established
side=responder dynamic-address=172.29.58.92 uptime=46s last-seen=46s
Now, What I'm wondering is.. why on earth would this cause exception such as above?
Duplicate key with different value?
So I went back and looked at the ones I was able to disconnect successfully and for those ones two of the local and remote ports were both reading 4500.
See below.
[admin@<HOST>] > /ip ipsec remote-peers print detail
Flags: R - responder, N - natt-peer
0 RN id="blah" local-address=X.X.X.X port=4500
remote-address=Y.Y.Y.Y port=4500 state=established side=responder
uptime=7m20s last-seen=1m19s
Now, I don't think I can do anything about Android phone using different remote port so how should I handle this case from the code?
Thank you,

Daniel
 
giguard
just joined
Posts: 13
Joined: Mon Oct 01, 2018 7:10 pm

Re: C# API - tik4net on GitHub

Thu Oct 11, 2018 6:28 pm

In case any one wondering what caused that execption,
            ITikReSentence id = connection.CreateCommandAndParameters("/ip/ipsec/remote-peers/print", "id", username).ExecuteSingleRow();
Thank you,

Daniel
 
User avatar
danikf
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 62
Joined: Mon Mar 14, 2011 8:57 am

Re: C# API - tik4net on GitHub

Thu Oct 11, 2018 6:53 pm

xxxxxxx/print command returns more than one =port=xxxx row in one !re sentence (this behavior was not expected and also not supported).
IMHO problem is, that there are two "port" fields - same name, different values. Works somehow because of their order ...

I would preffer this "stupid" behavior to be fixed by mikrotik guys (e.q. local-port, remote-port), but workaround could be also implemented in tik4net core - It will return port and port2 in this case.

Issue: https://github.com/danikf/tik4net/issues/51
Workarounded in dev branch: https://github.com/danikf/tik4net/commi ... 1cf91e24dd

As workaround (if you don't need port values) you can use .proplist filter (see API specification on mikrotik wiki) to return subset of fields you need.

D
 
giguard
just joined
Posts: 13
Joined: Mon Oct 01, 2018 7:10 pm

Re: C# API - tik4net on GitHub

Fri Oct 12, 2018 9:41 am

Thank you for the workaround. I didn't try the dev version of the api since proplist did the job.
BTW, Is there document on how to go about using the dev version?
Would this be possible with nuget?
Thank you,

Daniel
 
User avatar
danikf
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 62
Joined: Mon Mar 14, 2011 8:57 am

Re: C# API - tik4net on GitHub

Fri Oct 12, 2018 10:57 am

BTW, Is there document on how to go about using the dev version?
Would this be possible with nuget?
Hi,

just download sources from github (Git clone or *.zip download), reference them as projects and rebuild your application. This scenario is usefull for debuging non-trivial problems and also for understandig how tik4net works inside :-) All code updates (an usually new tik object classes) can be pushed back to the main branch via pull request feature ...

https://help.github.com/articles/cloning-a-repository/

D
 
javierur10
just joined
Posts: 1
Joined: Mon Jun 25, 2018 4:26 pm

Re: C# API - tik4net on GitHub

Mon Oct 15, 2018 6:49 am

Hello, Why this error?

Exception in System.Net.Sockets.SocketException
No connection could be made because the target machine actively refused it 12.12.12.1:8728
 
nescafe2002
Member
Member
Posts: 448
Joined: Tue Aug 11, 2015 12:46 pm
Location: Netherlands

Re: C# API - tik4net on GitHub

Mon Oct 15, 2018 12:11 pm

Your router is not accepting api connections. Go to IP > Services and check if api is enabled. Also check firewall and add appropriate input rule, e.g.:
/ip firewall filter
add chain=input dst-port=8728 in-interface-list=LAN protocol=tcp src-address=192.168.88.0/24
 
User avatar
saputra19
just joined
Posts: 7
Joined: Fri Mar 23, 2018 3:11 pm
Location: indonesia
Contact:

Re: C# API - tik4net on GitHub

Mon Oct 15, 2018 2:06 pm

now i have a small request.
can you add ip bindings object?
Hi,
what are you meaning by "ip binding object". Is it different from IpAddress object?

D
ip bindings from
ip/hotspot/ip-binding
 
khisrav
just joined
Posts: 2
Joined: Wed Oct 24, 2018 4:14 pm

tik4net, SSL connection exception

Wed Oct 24, 2018 5:18 pm

Hello guys!

First of all, thanks a lot for author for such incredible API library.
Had any one problems with ApiSsl connection? 'TikConnectionType.Api' works fine, but if I try 'TikConnectionType.ApiSsl' I have exception like this:

-------------
System.Security.Authentication.AuthenticationException
HResult=0x80131501
Message=Failed to call SSPI, see the internal exception
Source=tik4net
Arborescence des appels de procédure :
at tik4net.Api.ApiConnection.Open(String host, Int32 port, String user, String password) dans D:\Downloads\tik4net-master\tik4net-master\tik4net\Api\ApiConnection.cs :line 182
at tik4net.Api.ApiConnection.Open(String host, String user, String password) dans D:\Downloads\tik4net-master\tik4net-master\tik4net\Api\ApiConnection.cs :line 148
at tik4net.ConnectionFactory.OpenConnection(TikConnectionType connectionType, String host, String user, String password) dans D:\Downloads\tik4net-master\tik4net-master\tik4net\ConnectionFactory.cs :line 49
at tik4net.tests.ConnectionTest.OpenConnectionWillNotFail() dans D:\Downloads\tik4net-master\tik4net-master\tik4net.tests\ConnectionTest.cs :line 17

Internal exception: The received message was unexpected or incorrectly formatted
-------------

I googled problem and find several solutions, but no one works in my case. Any help will be appreciated. Thanks a lot.
 
User avatar
danikf
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 62
Joined: Mon Mar 14, 2011 8:57 am

Re: C# API - tik4net on GitHub

Thu Oct 25, 2018 12:12 pm

Is your mikrotik router properly configured? Which version of routeros do you use?

https://github.com/danikf/tik4net/wiki/SSL-connection

D
 
khisrav
just joined
Posts: 2
Joined: Wed Oct 24, 2018 4:14 pm

Re: C# API - tik4net on GitHub

Thu Oct 25, 2018 12:43 pm

Is your mikrotik router properly configured? Which version of routeros do you use?

https://github.com/danikf/tik4net/wiki/SSL-connection

D
Hello! Thank you very much, all is working fine! Have a nice day! :)
 
User avatar
danikf
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 62
Joined: Mon Mar 14, 2011 8:57 am

Re: C# API - tik4net on GitHub

Sat Oct 27, 2018 7:10 pm

ip bindings from
ip/hotspot/ip-binding
Here you are (and also commited in dev branch).
Enjoy,
D
namespace tik4net.Objects.Ip.Hotspot
{
    /// <summary>
    /// ip/hotspot/ip-binding
    /// 
    /// IP-Binding HotSpot menu allows to setup static One-to-One NAT translations, allows to bypass specific HotSpot clients without any authentication, and also allows to block specific hosts and subnets from HotSpot network 
    /// </summary>
    [TikEntity("ip/hotspot/ip-binding")]
    public class HotspotIpBinding
    {
        /// <summary>
        /// .id: primary key of row
        /// </summary>
        [TikProperty(".id", IsReadOnly = true, IsMandatory = true)]
        public string Id { get; private set; }

        /// <summary>
        /// address: The original IP address of the client
        /// </summary>
        [TikProperty("address", DefaultValue = "")]
        public string/*IP Range*/ Address { get; set; }

        /// <summary>
        /// mac-address: MAC address of the client
        /// </summary>
        [TikProperty("mac-address", DefaultValue = "")]
        public string/*MAC*/ MacAddress { get; set; }

        /// <summary>
        /// server
        /// Name of the HotSpot server.
        ///  all - will be applied to all hotspot servers
        /// </summary>
        [TikProperty("server", DefaultValue = "all")]
        public string/*string | all*/ Server { get; set; }

        /// <summary>
        /// to-address: New IP address of the client, translation occurs on the router (client does not know anything about the translation)
        /// </summary>
        [TikProperty("to-address", DefaultValue = "")]
        public string/*IP*/ ToAddress { get; set; }

        /// <summary>
        /// type
        /// Type of the IP-binding action
        ///  regular - performs One-to-One NAT according to the rule, translates address to to-address
        ///  bypassed - performs the translation, but excludes client from login to the HotSpot
        ///  blocked - translation is not performed and packets from host are dropped
        /// </summary>
        [TikProperty("type", DefaultValue = "")]
        public string/*blocked | bypassed | regular*/ Type { get; set; }
    }
}
 
shaun12
just joined
Posts: 2
Joined: Sat Nov 10, 2018 12:17 pm

Re: C# API - tik4net on GitHub

Sat Nov 10, 2018 12:23 pm

Hi, Danik
im strugling to get into 1 router from another would you mind telling me what im doing wrong?

ITikConnection initconnection = ConnectionFactory.CreateConnection(TikConnectionType.Api);
initconnection.Open("10.255.107.2", "admin", xxxx");
ITikCommand mac_telnetCmd = initconnection.CreateCommand("/tool/mac-telnet",
initconnection.CreateParameter("host", "64:D1:54:22:71:37"),
initconnection.CreateParameter("Login", "admin"),
initconnection.CreateParameter("Password", "xxxx"));
initconnection.CreateCommand("/ip/address/add/",
initconnection.CreateParameter("address", "192.168.9.1/24"),
initconnection.CreateParameter("network", "192.168.8.0"),
initconnection.CreateParameter("interface", "wlan2"));
 
nescafe2002
Member
Member
Posts: 448
Joined: Tue Aug 11, 2015 12:46 pm
Location: Netherlands

Re: C# API - tik4net on GitHub

Sat Nov 10, 2018 3:38 pm

Sorry, this is an unsupported feature:

https://wiki.mikrotik.com/wiki/API_comm ... e_commands
interactive command examples that will not work in API are:

/system telnet
/system ssh
/tool mac-telnet
 
User avatar
danikf
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 62
Joined: Mon Mar 14, 2011 8:57 am

Re: C# API - tik4net on GitHub

Sat Nov 10, 2018 6:17 pm

Sorry, this is an unsupported feature:
Hi,

I must agree with nescafe2002. (IMHO RoMon telnet/ssh is unsupported either). I tried to workaround it (by some trick) but was not successfull.
Some links to read:
viewtopic.php?t=99953
viewtopic.php?t=71262
Janisk (from mikrotik) citation: everything that looks suspiciously interactive, like ssh login or telnet login will not work if ran from scheduler or script.
I saw also some sample bash script (from some mikrotik guy) which uses ssh to neighbour machine to perform changes on another machine via RoMon/mactelnet internal feature (but I cant find it anymore).

Finaly I end up with wrapping mactelnet application (classic mikrotik windows neigbour app) and using it to play prepared script on selected machine. I have plan to release it as library, but it will take time ...
https://www.mikrotik.com/download/neighbour.zip

D
 
murdochs
just joined
Posts: 3
Joined: Mon Nov 12, 2018 10:01 am

Re: C# API - tik4net on GitHub

Tue Nov 13, 2018 1:37 am

Hi, thanks for this great api.
I am using the command "ITikCommand cmd = connection.CreateCommandAndParameters("/tool/user-manager/user/print", "?username", sUser);" to see if the user already exist.
and if so, I want to get the value of "Actual-profile" by using "vResult.GetResponseField("actual-profile")". If the user has already used their alooted usage, then "Actual-profile" does not exist in the sentence. How can I check if the value exist before get response ?
thanks
Sean
 
nescafe2002
Member
Member
Posts: 448
Joined: Tue Aug 11, 2015 12:46 pm
Location: Netherlands

Re: C# API - tik4net on GitHub

Tue Nov 13, 2018 1:09 pm

You can use GetResponseFieldOrDefault to have a default value as response or check the Words dictionary directly.

E.g.
var profile = vResult.GetResponseFieldOrDefault("actual-profile", "(none)");

or

if (vResult.Words.ContainsKey("actual-profile"))
{
  // Do something
}
 
murdochs
just joined
Posts: 3
Joined: Mon Nov 12, 2018 10:01 am

Re: C# API - tik4net on GitHub

Tue Nov 13, 2018 11:47 pm

thank-you. Was trying "GetResponseFieldOrDefault" but didn't have the second parameter.
 
BigTrumpet
Frequent Visitor
Frequent Visitor
Posts: 50
Joined: Thu Feb 07, 2008 7:46 pm

Re: C# API - tik4net on GitHub

Fri Nov 16, 2018 10:51 pm

Hi all,
I would need to get the real "speed rate" of an ethernet interface.

Using OS CLI I would type something like:
/interface ethernet monitor ether3 once
and response is something like that:
                      name: eth3-AP-AC-45
                    status: link-ok
          auto-negotiation: done
                      rate: 1Gbps
               full-duplex: yes
           tx-flow-control: no
           rx-flow-control: no
               advertising: 10M-half,10M-full,100M-half,100M-full,1000M-half,1000M-full
  link-partner-advertising: 10M-half,10M-full,100M-half,100M-full,1000M-half,1000M-full
I am interested in "rate" field.
How can I do with tik4net? I don't find this data using Interface or InterfaceMonitorTraffic objects.

Thank you.
Massimo
 
User avatar
danikf
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 62
Joined: Mon Mar 14, 2011 8:57 am

Re: C# API - tik4net on GitHub

Sat Nov 17, 2018 12:25 pm

Hi all,
I would need to get the real "speed rate" of an ethernet interface.
Here you are (also commited to DEV branch).

D
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace tik4net.Objects.Interface.Ethernet
{
    /// <summary>
    /// /interface ethernet monitor: command prints out current link, rate and duplex status of an interface. 
    /// </summary>
    [TikEntity("/interface/ethernet/monitor", LoadCommand = "", LoadDefaultParameneterFormat = TikCommandParameterFormat.NameValue, IncludeDetails = false, IsReadOnly = true)]
    public class EthernetMonitor
    {
        /// <summary>
        /// name
        /// </summary>
        [TikProperty("name", IsMandatory = true, IsReadOnly = true)]
        public string Name { get; private set; }

        /// <summary>
        /// auto-negotiation
        /// Current auto negotiation status:
        ///  done - negotiation completed
        ///  incomplete - negotiation failed or not yet completed
        /// </summary>
        [TikProperty("auto-negotiation")]
        public string/*done | incomplete*/ AutoNegotiation { get; set; }

        /// <summary>
        /// default-cable-settings
        /// Default cable length setting (only applicable to NS DP83815/6 cards)
        ///  short - support short cables 
        ///  standard - support standard cables
        /// </summary>
        [TikProperty("default-cable-settings")]
        public string/*short | standard*/ DefaultCableSettings { get; set; }

        /// <summary>
        /// full-duplex: Whether transmission of data occurs in two directions simultaneously
        /// </summary>
        [TikProperty("full-duplex")]
        public bool FullDuplex { get; set; }

        /// <summary>
        /// rate: Actual data rate of the connection.
        /// </summary>
        [TikProperty("rate")]
        public string/*10Mbps | 100Mbps | 1Gbps*/ Rate { get; set; }

        /// <summary>
        /// status
        /// Current link status of an interface
        ///  link-ok - the card is connected to the network
        ///  no-link - the card is not connected to the network
        ///  unknown - the connection is not recognized (if the card does not report connection status)
        /// </summary>
        [TikProperty("status")]
        public string/*link-ok | no-link | unknown*/ Status { get; set; }

        /// <summary>
        /// tx-flow-control: Whether TX flow control is used
        /// </summary>
        [TikProperty("tx-flow-control")]
        public string TxFlowControl { get; set; }

        /// <summary>
        /// rx-flow-control: Whether RX flow control is used
        /// </summary>
        [TikProperty("rx-flow-control")]
        public string RxFlowControl { get; set; }

        /// <summary>
        /// sfp-module-present: Whether SFP module is in cage
        /// </summary>
        [TikProperty("sfp-module-present")]
        public bool SfpModulePresent { get; set; }

        /// <summary>
        /// sfp-rx-lose: 
        /// </summary>
        [TikProperty("sfp-rx-lose")]
        public bool SfpRxLose { get; set; }

        /// <summary>
        /// sfp-tx-fault: 
        /// </summary>
        [TikProperty("sfp-tx-fault")]
        public bool SfpTxFault { get; set; }

        /// <summary>
        /// sfp-connector-type: 
        /// </summary>
        [TikProperty("sfp-connector-type")]
        public string SfpConnectorType { get; set; }

        /// <summary>
        /// sfp-link-length-copper: Detected link length when copper SFP module is used
        /// </summary>
        [TikProperty("sfp-link-length-copper")]
        public string SfpLinkLengthCopper { get; set; }

        /// <summary>
        /// sfp-vendor-name: Vendor of the SFP module
        /// </summary>
        [TikProperty("sfp-vendor-name")]
        public string SfpVendorName { get; set; }

        /// <summary>
        /// sfp-vendor-part-number: SFP module part number
        /// </summary>
        [TikProperty("sfp-vendor-part-number")]
        public string SfpVendorPartNumber { get; set; }

        /// <summary>
        /// sfp-vendor-revision: SFP module revision number
        /// </summary>
        [TikProperty("sfp-vendor-revision")]
        public string SfpVendorRevision { get; set; }

        /// <summary>
        /// sfp-vendor-serial: SFP module serial number
        /// </summary>
        [TikProperty("sfp-vendor-serial")]
        public string SfpVendorSerial { get; set; }

        /// <summary>
        /// sfp-manufacturing-date: SFP module manufacturing date
        /// </summary>
        [TikProperty("sfp-manufacturing-date")]
        public string SfpManufacturingDate { get; set; }

        /// <summary>
        /// eeprom: EEPROM of an SFP module
        /// </summary>
        [TikProperty("eeprom")]
        public string Eeprom { get; set; }

        /// <summary>
        /// Gets snapshot of actual values for given <paramref name="interfaceName"/>.
        /// </summary>
        public static EthernetMonitor GetSnapshot(ITikConnection connection, string interfaceName)
        {
            return EthernetMonitorConnectionExtensions.GetEthernetMonitorSnapshot(connection, interfaceName);
        }

    }

    /// <summary>
    /// Connection extension class for <see cref="InterfaceMonitorTraffic"/>
    /// </summary>
    public static class EthernetMonitorConnectionExtensions
    {
        /// <summary>
        /// Gets snapshot of actual values for given <paramref name="interfaceName"/>.
        /// </summary>
        public static EthernetMonitor GetEthernetMonitorSnapshot(this ITikConnection connection, string interfaceName)
        {
            var result = connection.LoadSingle<EthernetMonitor>(
                connection.CreateParameter("numbers", interfaceName, TikCommandParameterFormat.NameValue),
                connection.CreateParameter("once", "", TikCommandParameterFormat.NameValue));

            return result;
        }
    }
}
 
BigTrumpet
Frequent Visitor
Frequent Visitor
Posts: 50
Joined: Thu Feb 07, 2008 7:46 pm

Re: C# API - tik4net on GitHub

Sun Nov 18, 2018 9:31 pm

Hi all,
I would need to get the real "speed rate" of an ethernet interface.
Here you are (also commited to DEV branch).

D
Thank you very much Danikf!
 
murdochs
just joined
Posts: 3
Joined: Mon Nov 12, 2018 10:01 am

Re: C# API - tik4net on GitHub

Tue Nov 20, 2018 1:26 am

Good Morning, I am trying to replicate create-and-activate-profile customer="admin" profile="1G" test which works in winbox.

In c#, I have

ITikCommand cmd = connection.CreateCommandAndParameters("/tool/user-manager/user/create-and-activate-profile", "profile", comboBox1.Text, "customer", "admin", textBox8.Text);

I get an error message "missing word with 'ret'.". I tried a view combinations, but other error was "unknown parameter".

Can anyone please help ?

edit - ("/tool/user-manager/user/create-and-activate-profile", "numbers",textBox8.Text,"profile", comboBox1.Text, "customer", "admin");

The above worked by putting in the name "numbers" and I can see that the user got the new profile, but it still gave me error message "missing word with 'ret'."
Sean


edit 2 :) - got it to work, was using executescalar instead of executenonquery.

Who is online

Users browsing this forum: Jotne, tigro11 and 3 guests