I have an issue. I want to get radio-name through the C# api for winbox. In winboxs terminal works :put [/interface wireless get [/interface wireless find default-name=wlan1] radio-name] command, but not in C# api. I rode that, in api i can't uses [ ] marks, but i dont know how it write without it. I tried like this:
mikrotik.Send("/put ", true);
mikrotik.Send(".system identity get name", true);
foreach (string h in mikrotik.Read())
{
mkResult += h;
}
l_identify.Text = mkResult;
but its doesn't work. Everytime i get this:
!trap=category=0=message=no such command or directiory (put [)!trap=message=no such command prefix!done
Please help :<
PS: Sorry for my English :P
You are sending incorrect commands to the device.
You need to use this:
/interface/wireless/print
=.proplist=radio-name
?default-name=wlan1
.proplist contains list of fields to be returned, ?default-name=wlan1 is a condifion for filtering.
You can find more about Mikrotik API syntax in the official Wiki.
Related
I have one app that I wrote already reading from and writing to the iCloud. I am essentially using the same code in my new app to do the same thing, but for some reason it will not work, giving me the following error, "Couldn't get container configuration from the server". Let me clarify, with this new app it does puts an entry in iCloud under manage storage, but instead of being under the name of my app, it is under adhoc.
Here is the line in my info.Plist,
Here is the line from my Entitlements,plist
lastly, here is my identifier defined on the apple developer site,
I have verified and reverified that everything is pointing to the correct thing so I am baffled. Any help would be much appreciated.
EDIT I guess what it is doing is writing file to my phone, but when it goes to save data to it, it fails with this message, Here is my call to save the data.
CKRecordID recordID = new CKRecordID(strDate);
await Task.Delay(200);
// Save it to iCloud
await pvc.SaveToiCloud(newRecord);
Here is my code to save the record,
public async Task SaveToiCloud(CKRecord newRecord)
{
ThisApp.PrivateDatabase.SaveRecord(newRecord, (record, err) =>
{
Edit:
I was thinking that possibly the number of nodes I had was too many, so I took out the "dist" one you see below, but that did not help. I thought maybe that was why I was seeing module name of adhoc under icloud on my phone, but I guess I was wrong.
Old:
New:
Edit
I have been doing more digging and found that this line of code is actually the one throwing the error.
File.WriteAllText(Path.Combine(filePath.Path, name + date), "Test");
The name and date contain correct values and the path looks fine to me... I guess... Don't know actually how it should look. Here is how the file path is getting set right above this call,
NSUrl filePath = NSFileManager.DefaultManager.GetUrlForUbiquityContainer(null).Append("Documents", true);
If anyone could offer any advice, I would be most appreciative.
So, I finally figured out the issue and it works like a champ now. The issue was the case in my bundle id in my info.plist. In CloudKit the DB name was all lower case, but my bundle Id in my info.plist, had AdHoc as my last node instead of adhoc as was in the CloudKit. You might say, what does the bundle Id have to do with the iCloud name, and actually I am not really sure, but I noticed that it was taking the case of that last node from my Bundle Id, not the case specified in the iCloud definition as I have shown above. Hope this helps someone who is struggling with a similar issue Have a great day!
My app is developed using Unity3d (2018) and c#. The app is then build for iOS. Now, I want to use a custom scheme to launch my iOS app and provide some extra information:
some-custom-scheme://some-parameter=some-value
I've read in the Unity forum that the best way to do this is to create a plugin in Unity and hook into the iOS startup pipeline as described in the forum post like this:
-(BOOL)application:(UIApplication*) application didFinishLaunchingWithOptions:(NSDictionary*) launchOptions
{
NSArray *keyArray = [launchOptions allKeys];
if ([launchOptions objectForKey:[keyArray objectAtIndex:0]]!=nil) {
NSURL *url = [launchOptions objectForKey:[keyArray objectAtIndex:0]];
NSString *urlString = [url absoluteString];
[[NSUserDefaults standardUserDefaults] setObject:urlString forKey:#"url"];
[[NSUserDefaults standardUserDefaults] synchronize];
}
return [super application:application didFinishLaunchingWithOptions:launchOptions];
}
Within the app, I simply check the PlayerPrefs like this:
var url = PlayerPrefs.GetString("url");
The url value however is empty. Iterating through the keys and alerting them in the app give two results: UIApplicationLaunchOptionsKey and UIApplicationLaunchOptionsSourceApplicationKey. Both irrelevant according the Apple documentation which state that the data should be in the UIApplicationLaunchOptionsAnnotationKey key.
I've also read this SO question telling the poster to use the openURL method.
I feel that I'm close but not there yet. What am I doing wrong and how can it be fixed? Which method is better? My approach using didFinishLaunchingWithOptions or the openURL method?
Any help is greatly appreciated!
Method openURL need for opening link. NSUserDefaults - local storage for app.
if need save you color scheme need use NSUserDefaults, if need opening link for use new color scheme need use openURL.
Save to NSUserDefaults
NSString *urlScheme = #"some-custom-scheme://some-parameter=some-value";
[[NSUserDefaults standardUserDefaults] setValue:urlScheme forKey:#"url"];
[[NSUserDefaults standardUserDefaults] synchronize];
Read NSUserDefaults
NSString *loadUrlScheme = [[NSUserDefaults standardUserDefaults] valueForKey:#"url"];
//loadUrlScheme = some-custom-scheme://some-parameter=some-value
I am not a c# guy. Needless to say that I don't have experience on this topic.
I bought a software and I installed it on my computer. Now I thought of using some of it's functions on my software(that I make to plan in c#). So I messaged the person who sold me the software and he send me a two page pdf file explaining what to do.
It states:
This software features a COM interface.
And it goes saying it's API contains a function "stackAPI".
and the parameters used are apiname type string, apipass type string.
Return values type long. 0 for sucess and 1 for error.
That's all it states, I tired searching google, it could not help me at all. So how do I start?
when I write the following code on c# it gives me error.
string[] apiname;
string[] apipass;
stackAPI(apiname, apipass);
I know if I was using dll I would import it as
[DllImport("example.dll"]
But no dll is provided.
Do I need to add the path to the folder where the software is installed to call the API ?
To get started:
using example.dll;
Then in your main class:
example.CustomService api = new example.CustomService();
var response = api.Dostuff();
Console.WriteLine(response);
If anyone wants to know how I did it. After a week of searching I was able to find the solution today. I wanted to call the function stackAPI(apiname, apipass);.
stackAPI(apiname, apipass) was the member of stack.callapi
So I wrote:
dynamic lifestohack = Activator.CreateInstance(Type.GetTypeFromProgID("stack.callapi"));
than just you can call the function like this.
int rv;
string[] apiname;
string[] apipass;
rv=lifestoahck.stackAPI(apiname, apipass);
Hope it may help someone.
I'm trying to connect to an rtmps server using C# and FluorineFX.
I'm doing this using this code
netConnection = new NetConnection();
netConnection.OnConnect += onConnect;
netConnection.NetStatus += netStatus;
netConnection.ObjectEncoding = ObjectEncoding.AMF3;
Console.WriteLine(netConnection.PlayerVersion = "WIN 10,1,85,3");
netConnection.Connect("rtmps://example.com:2099/");
example.com is replacing the real url in this example.
But this code only gives me an exception stating that:
System.UriFormatException: One of the identified items was in an invalid format
the FluorineFX webpage states that it supports rtmps, so i would think that would be the case. Any help would be greatly appreciated.
I found a github repo that adds RTMPS support into FlourineFX
https://github.com/epicvrvs/FluorineFXMods
All you need to do is follow the instructions in the top and compile it.
The documentation of the API shows source code on how to accomplish this in Python:
#!/usr/bin/python
import pycurl
c = pycurl.Curl()
values = [
("key", "YOUR_API_KEY"),
("image", (c.FORM_FILE, "file.png"))]
# OR: ("image", "http://example.com/example.jpg"))]
c.setopt(c.URL, "http://imgur.com/api/upload.xml")
c.setopt(c.HTTPPOST, values)
c.perform()
c.close()
I'd like a bit of guidance on how to do this in C#. For instance, I'm lost on what these "values" would be in C#, how would I even declare them?
I'm not familiar with cURL at all, so that might be holding me back from translating a bit.
Help me Obi-wan. You're my only hope. /click
You just need to perform an HTTP POST, e.g. this code with a "parameters" string of key=YOUR_API_KEY&image=http://example.com/example.jpg or the like.