dps69208 2010-01-17 16:14
浏览 137
已采纳

从VB.NET应用程序发送文件到PHP脚本

I need to send some data from a SQL DB Server on an internal network to an external web server.

I was hoping to accomplish this by writing a VB.NET app that is invoked once per day that sends about 1 MB of data to a PHP script on the web server, where it is deposited in a database.

What is a good method to send data to a PHP script from a .NET app?

  • 写回答

5条回答 默认 最新

  • dongtang1944 2010-01-17 17:00
    关注

    You can use the HTTPWebRequest class to post a file to your php script just as a browser would. If the file you are sending is text based like XML or CSV, a simple post could be done. However, if you need to send binary data, you could either encode it base64 and then decode it on the other end in PHP, or post it as a file, using multipart forms. Unless you have a specific reason to be using multipart forms, it probably isn't worth all the extra trouble, and you should probably just encode your data with base64.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(4条)

报告相同问题?