von einer app nach PHP und zurück

  • C#
  • .NET (FX) 4.0

Es gibt 3 Antworten in diesem Thema. Der letzte Beitrag () ist von Radinator.

    von einer app nach PHP und zurück

    Hallo zusammen,

    Ich möchte mich mit Visual Basic und Windows App beschäftigen. Mit anderen Worten ist das neu Land für mich!

    Meine Frage ist jetzt:
    Wie kann ich mit der App und PHP Daten per Internet austauschen?

    Beispiel habe in PHP $zahl =1 und mochte die in der App weiter verarbeiten und zurück.

    Danke für die Antwort
    Hallo @sams!

    sams schrieb:

    wo ist da der unterschied
    Google doch mal nach "[url='http://[quote='sams','https://www.vb-paradise.de/index.php/Thread/122715-von-einer-app-nach-PHP-und-zurück/?postID=1065376#post1065376']Wie kann ich mit der App und PHP Daten per Internet austauschen?[/quote]']difference between uwp and desktop[/url]":
    One
    of the big differences is that UWP apps can be sold through the Windows
    Store (though you will be able to sell packaged WPF apps in the store
    eventually).

    UWP apps are sandboxed, and as a result have many restrictions on
    what they can do. If your application needs to do things that UWP
    doesn't allow (arbitrarily accessing the file system, for example), then
    you'll have to use WPF.

    Conversely, UWP apps allow access to certain user-friendly
    functionality like plugging into share contracts, live tiles that you
    can't do with WPF. If you want your app to run on small tablets and/or
    phones (or even Xbox One) you'll need to use UWP.

    From a programming standpoint they are not very different really.
    - reddit.

    sams schrieb:

    Wie kann ich mit der App und PHP Daten per Internet austauschen?
    Das kannst du entweder über WCF machen oder (was ich empfehle) dir die Daten über eine REST Schnittstelle bereitstellen. Hierzu - vereinfacht gesagt - im PHP Script das Ergebnis, welches du an die App liefern willst per echo ausgeben lassen und um die Daten zu empfangen, in deiner Anwendung über einen WebClient/HttpClient das Script auf dem Webserver aufrufen und die Anwort (Response) speichern. Bei REST hast du die Möglichkeit das ganze als JSON oder XML auszugeben. Sollte es sich allerdings nur um kleine Datenmengen handeln, kann man auch Text verwenden.
    Vor dem Ausgeben der Daten muss jedoch im Header gesagt werden, WELCHE Art von Daten erwartet werden:

    PHP-Quellcode

    1. header('Content-Type: application/json; charset=utf8');
    2. echo(json_encode(...);


    Lg Radinator
    In general (across programming languages), a pointer is a number that represents a physical location in memory. A nullpointer is (almost always) one that points to 0, and is widely recognized as "not pointing to anything". Since systems have different amounts of supported memory, it doesn't always take the same number of bytes to hold that number, so we call a "native size integer" one that can hold a pointer on any particular system. - Sam Harwell