Code:
'Date Created: 29-May-2016 07:24:23 PM 'Last Updated: 29-May-2016 07:34:19 PM 'Created By :KM4OUS 'Updated By :KM4OUS dim shared qsod as C dim shared qtime as C dim shared qcall as c dim shared qband as c dim shared qfreq as c dim shared qmode as c dim shared qrsts as c dim shared qrstr as c dim shared stacall as c dim shared stagrid as c dim shared stadxcc as c qsod = date_format(DATE() , "yyyyMMdd") qtime=time("0hMMs", now(.T.)) qcall="s4rg" qband="40m" qfreq="7.185" qmode="SSB" qrstr="59" qrsts="59" stacall="km4srg" stagrid="EL88PF" stadxcc="3" dim rqbody as c dim shared strADIF as c strADIF =" &<QSO_DATE:8>"+qsod+" <TIME_ON:6>"+qtime+" <CALL:4>"+qcall+" <BAND:3>"+qband+" <FREQ:9>"+qfreq+" <MODE:5>"+qmode+" <RST_SENT:3>"+qrsts+" <RST_RCVD:3>"+qrstr+" <STATION_CALLSIGN:6>"+stacall+" <GRIDSQUARE:6>"+stagrid+" <DXCC:3>"+stadxcc+"<EOR>" dim shared Callsign as c dim shared Code as C dim shared App as C dim shared Cmd as c dim shared ADIFkey as c dim cred as c dim etn as c etn="http://robot.hrdlog.net/newentry.aspx" cred="Callsign=TEST&Code=0000000000&App=KM4OUS Logger&ADIFData="+strADIF Cmd="GETQSO" ADIFkey="<CALL:4>"+qcall+"<QSO_DATE:8>"+qsod+" <TIME_ON:6>"+qtime+" <BAND:3>"+qband rqbody= cred dim Result as p Result=http_post(etn,rqbody) reply = Result.body ui_msg_box("Response",reply,UI_ATTENTION_SYMBOL)
Code:
using System.Net; using System.IO; try { equest request = (HttpWebRequest)HttpWebRequest.Create("http://robot.hrdlog.net/newentry.aspx"); request.Timeout = 5000; request.ReadWriteTimeout = 20000; request.Method = "POST"; request.ContentType = "application/x-www-for -urlencoded"; string strADIF = "<QSO_DATE:8>20100606 <TIME_ON:6>135000 <CALL:5>LU2DC <BAND:3>15m <FREQ:9>21.070000 <MODE:5>PSK31 <RST_SENT:3>599 <RST_RCVD:3>599 <STATION_CALLSIGN:6>IW1QLH <GRIDSQUARE:6>GF12ea <DXCC:3>100 <EOR>"; // this string can?t contain the ampercent (&) string strForm = IF; "Callsign=TEST" + "&Code=0000000000" "&App=YourApplicationName" + "&ADIFData=" + strADIF // here the callsign // here the upload code // optional, here it?s possible to send the application name request.ContentLength = strForm.Length; StreamWriter sw = new StreamWriter(request.GetRequestStream(), Encoding.ASCII); sw.Write(strForm); sw.Close(); HttpWebResponse response = (Htt WebResponse)request.GetResponse(); StreamReader responseStream = new StreamReader(response.GetResponseStream()); result = responseStream.ReadToE } catch (Exception ex) { }
You must use a HTTP request to http://robot.hrdlog.net/NewEntry.aspx ; only POST is allowed.
Your request must contain this fields:
• ADIFData: contact data formatted using ADIF rules; p.e. <QSO_DATE:8>20100606 <TIME_ON:6>135000
<CALL:5>LU2DC <BAND:3>15m <FREQ:9>21.070000 <MODE:5>PSK31 <RST_SENT:3>599 <RST_RCVD:3>599
<QSL_SENT:1>N <QSL_RCVD:1>N <STATION_CALLSIGN:6>IW1QLH <GRIDSQUARE:6>GF12ea <DXCC:3>100 <EOR>
• Callsign: user callsign
• Code:the upload code received via email after the registration to HRDLOG net
• App (recommended): application name
Comment