Home Backend Development PHP Tutorial 施用PHP Snoopy同步数据到.net系统

施用PHP Snoopy同步数据到.net系统

Jun 13, 2016 am 11:01 AM
net php snoopy

使用PHP Snoopy同步数据到.net系统

??? 很久没有做web了,今天一个同事朋友说她那里有需求将PHP网站数据同步到.net网站系统里面,给自己下面的人做了几天都没有结果,呵呵。请求帮忙,这个很简单。跨语言通讯2000年时候最流行就是使用Corba了(叫什么公用对象XX框架,华为管理电信机房东东就这个做了,C++和java通讯),目前简单实现就是webservice或RPC,远程网站开一个请求入口,本地去请求这个入口返回xml数据解析。类似这样的服务。通常java对PHP使用 RMI或Hessian等框架,PHP对其他语言使用Hessian或http Snoopy通讯,Actionscript对PHP或java使用amf或其他RPC通讯框架。好了,不卖官子了。我大概就讲讲snoopy对.net实现数据同步。

??? 一·在.net系统公开一个接口,简单说就是写.aspx页面接收远程数据(在本例就是远程网站用户注册以后的信息如用户id,用户姓名等)。建立一个RemoteService.aspx页面大致代码如下:

??? String userid=Resquet.QueryString("userid");

String userName=Resquet.QueryString("userName");

SqlConnection

con = new SqlConnection("server=xx;database=school;uid=sa;pwd=luodongfu");
comm = new SqlCommand("insert into XXX() ..."");

?? 下面就是把这些东西保存到你.net数据库了,几年没有用过.net,忘记了自己google看一下。别忘记做安全以及重复验证哦,这里。

?

?二 .在php? Discuz 的lib引入snoopy.php (自己去下载)注册成功返回页面上如下些:

include("snoopy.php");

$snoopy = new Snoopy;

$formvars["userName"] = "luodongfu";

$formvars["userid"] = "123456";

这个网站及就是我们上面写的那个系统页面了

$action = "http://www.luodongfu.cn/RemoteService.aspx"/;//表单提交地址

$snoopy->submit($action,$formvars);//$formvars为提交的数组

?

ok,就这么简单,半个小时搞定,那应该算时间都太多了。这是最简单的基本功,呵呵

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

PHP 8.4 Installation and Upgrade guide for Ubuntu and Debian PHP 8.4 Installation and Upgrade guide for Ubuntu and Debian Dec 24, 2024 pm 04:42 PM

PHP 8.4 brings several new features, security improvements, and performance improvements with healthy amounts of feature deprecations and removals. This guide explains how to install PHP 8.4 or upgrade to PHP 8.4 on Ubuntu, Debian, or their derivati

CakePHP Date and Time CakePHP Date and Time Sep 10, 2024 pm 05:27 PM

To work with date and time in cakephp4, we are going to make use of the available FrozenTime class.

CakePHP Working with Database CakePHP Working with Database Sep 10, 2024 pm 05:25 PM

Working with database in CakePHP is very easy. We will understand the CRUD (Create, Read, Update, Delete) operations in this chapter.

CakePHP File upload CakePHP File upload Sep 10, 2024 pm 05:27 PM

To work on file upload we are going to use the form helper. Here, is an example for file upload.

CakePHP Routing CakePHP Routing Sep 10, 2024 pm 05:25 PM

In this chapter, we are going to learn the following topics related to routing ?

Discuss CakePHP Discuss CakePHP Sep 10, 2024 pm 05:28 PM

CakePHP is an open-source framework for PHP. It is intended to make developing, deploying and maintaining applications much easier. CakePHP is based on a MVC-like architecture that is both powerful and easy to grasp. Models, Views, and Controllers gu

CakePHP Creating Validators CakePHP Creating Validators Sep 10, 2024 pm 05:26 PM

Validator can be created by adding the following two lines in the controller.

CakePHP Logging CakePHP Logging Sep 10, 2024 pm 05:26 PM

Logging in CakePHP is a very easy task. You just have to use one function. You can log errors, exceptions, user activities, action taken by users, for any background process like cronjob. Logging data in CakePHP is easy. The log() function is provide

See all articles