0

嗨,我需要苹果直接主机的imei检查源代码: https ://selfsolve.apple.com/warrantyChecker.do?sn=IMEI

进口系统.Net

Public Class Form1 '获取值 Private WithEvents webclient As New webclient Public Function getresult(ByVal url As String) As String Return New System.Text.UTF8Encoding().GetString(webclient.DownloadData(url)) End Function

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    TextBox2.Text = getresult("https://selfsolve.apple.com/warrantyChecker.do?sn=" + TextBox1.Text)
End Sub

结束类

我使用这个脚本,但是当我从网页获取原始数据时(在文本框中查看源代码而不是数据示例(IMEI、MODEL、Carrier 等),你能帮我制作自己的软件或 php 脚本吗?

4

1 回答 1

1

你的问题不是真正的问题。这更像是一个任务。

该 URL 会返回一个您需要解析的 JSONP 对象。

你说你想要一个 php 脚本来告诉你如何解析 JSON 对象,所以你需要这样做:

<?php
$sn = $_GET['sn'];
//load the input (the serial number), you should then perform input filtering on the SN by filtering out non required characters

$o = file_get_contents("https://selfsolve.apple.com/warrantyChecker.do?sn=".$sn);
//fetch the URL's response body into a variable

$o = json_decode($o, true);
//decode the json object into an array

print_r($o);
//recursively print the array to show you what's inside the array
?>

调用它:scriptname.php?sn=ENTER_SN_HERE

于 2012-06-22T09:36:09.313 回答