I write system, that collects informations about local system. It's a system like admin-client. Client collects and sends log to admin. There's of course possibility to get this log by admin over LAN, but I'd like to add option send log over Internet.
I thought about skype. Client must have logged skype and when admin (of course there must be appropriate authorization, but it's separate topic) send request by skype - client must e.g. connect to SQL database or simple file with collected log and send it over skype.
How can I do this?
Is this the best way? Plugin in skype? What lib may I use?
I think it's an either/or situation.
If you want an administrator who is already using Skype to be able to send this information over the internet, then a plugin which exposes that functionality in Skype is the way to go.
If you want the administrator to be able to send the information over Skype's network, but not necessarily have to have the application running (perhaps this will be done through the application that gathers data), then using the API to control Skype externally is better.
You can find the documentation for Skype here:
http://developer.skype.com/accessories
Skype has a COM API called Skype4COM which you could use through COM interop in order to access Skype.
It should be noted that SkypeKit is now available for use in both embedded and desktop programs. There's a small one-time registration fee (currently $5 USD) for each program, but it will allow you to access Skype without actually using any UI functionality (it's completely up to you to provide the interface).
Until SkypeKit is released, you're limited to the Skype Public API. However according to the docs this API only allows to specify the recipient and open the file dialog, initiating a file transfer automatically seems to be impossible (see "OPEN FILETRANSFER" in the docs).
I suggest you use an open protocol like HTTP or FTP instead.
Related
As the Title suggest, i am trying to Read and Write (R&W) Contact and Event information to multiple Outlook Accounts/Profiles in a local computer, while Outlook is set to Work Offline.
So far i discovered two ways to R&W contacts and Events to Outlook:
1.- Microsoft.Graph:
This seems to work only online, since it reads and writes to the Microsoft server, not to the local pst/ost files.
2.- microsoft.office.interop.outlook library:
This does work offline/locally (by accessing the Outlook pst/ost files) but the approach i am using so far requires the creation of an Application object as
var app = new Microsoft.Office.Interop.Outlook.Application();
Nevertheless, creating an Application object implicitly logs in a profile/user to the application, and further, if Outlook is already running and logged in with a Profile X, the code above instantiates an Outlook object in which the Profile X is logged in, so in that scenario i can only R&W Contacts and Events for that specific user/Profile.
So, is there a way to be able to R&W Contact and Event information for different profiles independently of if Outlook is running with a Profile X?
Well, there is no magic - if you want offline access, something needs to implement the storage to keep the cached data and cache your changes so that they can be uploaded when the server comes back online.
If you don't want to implement that logic, cached Outlook profile is probably your only choice. You are right that Outlook, being a singleton, can only access one profile at a time. You can use Extended MAPI to access a profile other than the other used by Outlook, but it is C++ or Delphi only. If using Redemption is an option (I am its author), it wraps Extended MAPI API for use in any language (C# included) - you can use its RDOSession.Logon method to access any existing profile.
I have developed (using C#) an Outlook add-in, which implements some rules on client side.
It receives each incoming mail, and if it fits some rules it locates it in a specific folder. The main issue is that it works fine, only when outlook client is open on user pc. If it is closed it does not work, because it is triggered on client's pc.
I wonder if it can get developed or moved somehow on server side (Microsoft 365 Exchange Server), so it works 24/7.
How complicated is the logic in code you have written ? eg a lot of the logic your talking about can be done in Office365 using Flow without needing to write any code (you can even write custom connectors for more advanced logic). You won't be able to use the Outlook code you have written but you can do the same thing using either the Microsoft Graph API and Webhooks to listen to incoming email and then use the Graph operations to perform whatever logic you have (host the app on Azure etc or even can be a server-less function hosted on Azure or AWS) or using EWS Notifications https://learn.microsoft.com/en-us/exchange/client-developer/exchange-web-services/notification-subscriptions-mailbox-events-and-ews-in-exchange
** Edit - Based on further questoins **
I'm writing a c# application, that uses ConfidentialClientApplication. I have set up the application in azure and can connect and get a token.
The software will in fact, reside on a server, it will look something like this:
A backend process will query the mailbox and get either a) A list of messages or b) the first message available
It will download hte message and strip any attachments for further processing
Once the processing is complete, it will need to move the mail to a folder, so that it is not processed again
I want to be able to pass the application, the mailbox name and the password to connect to it, a bit like POP3/IMAP. So far, I can get a token, but anything beyond that, just barks that it doesnt have access, quite rightly.
So how do I take this one step further, and either:
Grant the application access to a specific mailbox using azure portal
or
Configure the application to read the mailbox from a settings file and connect to it?
Many thanks!
Tirm
What I'm trying to do is set up a SharePoint event receiver so that when an item is added to a SharePoint calendar, a reminder is setup in Lotus Notes with the same title/date/time.
I was able to create a Windows Forms Application that creates the Lotus Notes reminder, but when I put that code into a SharePoint event receiver, it doesn't run. I even tried putting some other code in the receiver that I know works, but with the Notes code in there, nothing runs at all.
Is it just not possible to do this because the Lotus Notes code needs to be run on a machine with a Notes client on it?
Yes, if you are using interop classes, you need to have a Notes installation on the machine, otherwise the DLLs that expose the Notes COM API aren't there for you to call. And this could be problematic if your SharePoint server is 64 bit, because IBM does not support the COM API on Win64. It can be made to mostly work, but it's not a good idea to go down that road.
There might be, however, other possible ways to do what you want. Domino can be configured for access via HTTP and supports web services and more recent versions support REST APIs.
As the Out of the box Lotus Search connector requires to have lotus on the local computer, I suppose you are right. You should have lotus on the local box.
It's logic actually, as the Lotus code requires to have the lotus libraries available, unless there is some http API or similar.
Is there an easy way to send group chat messages to Skype from .NET? I don't need to respond to any commands or anything, so it doesn't need to be a BOT. Basically, I would run this program on a dedicated box with Skype running as a special user and I would have it report certain information to a specific group chat.
I understand there is a Skype COM library. I have seen examples based on that but I haven't been able to get any traction.
The currently available Skype API for Windows uses WM_COPYDATA to exchange text-based commands for controlling Skype (see the Public API Reference download). There is a new thing called SkypeKit in development but it's a closed beta so I don't know what it will do to enhance the experience.
There appear to have been a few projects here and there that have wrapped the existing public API with some .NET-based calls using C#. These either wrap the basic level messaging system or the COM wrapper, Skype4COM (as you have already seen). A Google search gave me these results that seem to get you started:
Controlling Skype with C#
How to do Skype in C#
C# Example Project for Skype4COM
Based on your experiences, I would look at the first item in this list as it appears to be a directly interacting with the Windows messages (i.e. WM_COPYDATA) rather than Skype4COM.
Sending a chat message to a group
Assuming you utilise the C# wrappers referenced above, here is a rough idea of the commands you'll need from the public API in order to send a chat message to a group.
The command to start a chat is CHAT CREATE. It appears from the documentation that you have to specify each recipient (or target, as the written in the API reference) individually. Whether this can be a group name or not is not made clear, however, the GET GROUP USERS command enables you to obtain the individual users within a specific group.
Once you have a chat, you can use the CHATMESSAGE command to actually post a message.