Pass arguments to running application

前端 未结 5 1024
猫巷女王i
猫巷女王i 2020-12-01 08:20

I am making an image uploader (upload image to image hosting website) and I\'m having some issues passing an argument (image location to an already running application)

5条回答
  •  感情败类
    2020-12-01 09:16

    Well you will have to establish a communication channel for other applications to post the images to. This communication channel can be one of the following - not a complete list just samples:

    • A directory that is watched by your app and the file is added once it is added to the directory.
    • A port where other applications can send information to.
    • A self-hosted web service that accepts the images.
    • A TCP port that receives the images.
    • A named pipe.
    • ....

    As you see there are several possibilities. The right one for you depends on your scenario. The file system is an option that can be implemented easily using a FileSystemWatcher for a sample see here.

    A self-hosted web sevice exposes a web service that can receive images. See here for a sample.

    IMHO, these are the two options that are easiest. But ... there are several more.

    For the TCP port see Tim's post.

提交回复
热议问题