从Pachube提要VB.net进行转换

从Pachube提要VB.net进行转换,vb.net,visual-studio-2013,xively,Vb.net,Visual Studio 2013,Xively,正在尝试使用Visual Studio 2013将旧的Pachube提要转换为Xively。收到一个400错误 这是我的代码库的一个片段。它仍然可以与我以前的pachube提要一起使用,但在更改为xlivey api之后,它就不再工作了 Dim PachubeStream As String = timestamp + "," + PT1Meter + "," + PT2Meter + "," + LevelOffset + "," + CurrentLevel + "," + PT1Raw +

正在尝试使用Visual Studio 2013将旧的Pachube提要转换为Xively。收到一个400错误

这是我的代码库的一个片段。它仍然可以与我以前的pachube提要一起使用,但在更改为xlivey api之后,它就不再工作了

Dim PachubeStream As String = timestamp + "," + PT1Meter + "," + PT2Meter + "," + LevelOffset + "," + CurrentLevel + "," + PT1Raw + "," + PT2Raw + "," + PT1Offset + "," + PT2Offset + "," + RateofRise + "," + PeakRateofRise
'prepare to Upload the latest changed data to pachube for on-line data storage and plotting

Dim myWebClient As New WebClient()     
uploaddatapachubekey = TextBox7.Text
myWebClient.Headers.Add("X-ApiKey", uploaddatapachubekey)
' Apply ASCII Encoding to obtain the string as a byte array.
Dim byteArray As Byte() = Encoding.ASCII.GetBytes(PachubeStream)
'added 11/11/2010
'configure uploaddata pachube port url
uploaddatapachubeport = "https://api.xively.com/v2/feeds/" + pachubeport + ".csv"
'UploadData input string using Http 1.0 PUT Method if not in test mode
'added 11/11/2010
If TestMode = False Then myWebClient.UploadData(uploaddatapachubeport, "put", byteArray)

解决了我自己的问题。问题是所有数据提交的新格式是 “频道名称”,时间戳UTC格式,频道数据VBCRLF

i、 e


Dim PachubeStream As String=“PT1Meter”+”、“+timestamp+”、“+PT1Meter

解决了我自己的问题。问题是所有数据提交的新格式为“通道名称”,时间戳UTC格式,通道数据VBCRLF,即Dim PachubeStream为String=“PT1Meter”+,“+时间戳+”,“+PT1Meter