I am beginner to Thingworx .Net SDK.
Is any mechanism to identify and alert file name to thingworx or Edge, once new file created or generated in Virtual Directory in client.
If no direct built-in functions or services, kindly let me know the best resolution to achieve it.
Thanks for reaching out to us.
Could you please clarify it more, what do you mean by creating a file in Virtual directory. Are you talking about creating new entities?
Thanks for reaching me.
It mean that, if any new file found in the virtual Directory (in client's file system like C:\UploadFiles), it needs to be notified to thingworx platform with filename, so thingworx can process the file immediately.
You can write down a code in .net SDK which keeps an eny on a particular folder if new file is added there or not.
FileSystemWatcher watcher = new FileSystemWatcher(); watcher.Path = pathToWatch; watcher.Created += new FileSystemEventHandler(OnChanged); watcher.Renamed += new RenamedEventHandler(OnRenamed); watcher.EnableRaisingEvents = true;
Now, either you can use some property by setting it to some value or you can use events to raise alerts.
If you feel previous response on this thread was resolution of your question, please mark it as accepted solution for the benefit of other community users.