我正在尝试生成一个 unix 时间戳,并且必须发送一个具有初始时间和响应时间的 webrequest
我试过这段代码
long ticks = DateTime.UtcNow.Ticks - DateTime.Parse("01/01/1970 00:00:00").Ticks;
ticks /= 10000;
string timestamp = ticks.ToString() + "000000";
label1.Text = timestamp;
int k=0;
for (int i = 0; i < 100; i++)
{
k = k + i;
}
long ticks2 = DateTime.UtcNow.Ticks - DateTime.Parse("01/01/1970 00:00:00").Ticks;
ticks2 /= 10000;
string timestamp2 = ticks.ToString() + "000000";
label2.Text = timestamp2;
我必须像这样发送请求
{
"options": {
"events": [
{
"event_type": 13,
"view_type": 1,
"view_parameter": 92,
"request_identifier": %2",
"time": 1382060060538000000,
"event_data": {}
}
],
"report_time": 1382060072238000000
},
"context": {
"app_version":"6590b21"
}
}
错误是,两个标签框上的输出都相同http://prntscr.com/1y0v7p