Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

C# 

Send data to website

Hey there

I'm trying to create a program that reads my cpu temperature (already done), and now i want to send it to my website so that i can monitor my temps from whatever device through that website. I'm kinda stuck right now :( I don't know how i'm going to solve this... Hope some of you can point me in the right direction  ✌
You should give a look into C# web request library
https://docs.microsoft.com/en-us/dotnet/...work-4.7.2
(Mar 23, 2019 07:25 AM)Onireves Wrote:  You should give a look into C# web request library
https://docs.microsoft.com/en-us/dotnet/...work-4.7.2

Will it be able to handle requests every second?
(Mar 23, 2019 07:32 AM)Flzduden Wrote:  Will it be able to handle requests every second?

Yeah
(Mar 23, 2019 07:34 AM)Onireves Wrote:  Yeah

Thank you!
Code
using System.Net;

WebClient client = new WebClient();
string downloadString = client.DownloadString("http://domain.com/cpu.php?temp=" + cputemp);

This should help you.
(Mar 23, 2019 10:24 AM)the6ix Wrote:  
Code
using System.Net;

WebClient client = new WebClient();
string downloadString = client.DownloadString("http://domain.com/cpu.php?temp=" + cputemp);

This should help you.

I do not think this is the answer which the user requested,as far as i understand, he wants to send data to web site not to pull them off.Onireves gave him a good reference if the user has looked at what is recommended to him.
buy me a coffee eth:0x88621A52aa5Eb3b6503628369687111810186c58
(Mar 23, 2019 11:25 AM)itcorp Wrote:  I do not think this is the answer which the user requested,as far as i understand, he wants to send data to web site not to pull them off.Onireves gave him a good reference if the user has looked at what is recommended to him.

http://domain.com/cpu.php?temp=" + cputemp

This sends data via get method
(Mar 23, 2019 11:36 AM)Onireves Wrote:  http://domain.com/cpu.php?temp=" + cputemp

This sends data via get method

Yes,but at the same time it perform GET, but for me seems it more logically to use the upload function of WebClient class and actually perform POST because what I understand from his post it's about sending data and I think the correct usage is via upload functions.
buy me a coffee eth:0x88621A52aa5Eb3b6503628369687111810186c58
(Mar 23, 2019 12:10 PM)itcorp Wrote:  Yes,but at the same time it perform GET, but for me seems it more logically to use the upload function of WebClient class and actually perform POST because what I understand from his post it's about sending data and I think the correct usage is via upload functions.

In this can, it's doesn't matter, and it's much more simple to use the GET method.

https://www.diffen.com/difference/GET-vs...P-Requests
(Mar 23, 2019 12:16 PM)Onireves Wrote:  In this can, it's doesn't matter, and it's much more simple to use the GET method.

https://www.diffen.com/difference/GET-vs...P-Requests

I took this into consideration now,nice conversation thank you
buy me a coffee eth:0x88621A52aa5Eb3b6503628369687111810186c58
(Mar 23, 2019 12:26 PM)itcorp Wrote:  I took this into consideration now,nice conversation thank you

It’s much easier and does the same thing.
(Mar 23, 2019 12:10 PM)itcorp Wrote:  Yes,but at the same time it perform GET, but for me seems it more logically to use the upload function of WebClient class and actually perform POST because what I understand from his post it's about sending data and I think the correct usage is via upload functions.

Exactly what i mean! I won't need any response from the site in my application.

Anyways, does any of you know if it's possible to call a script (within html) from c#? And pass the temp with it?  😧
(Mar 23, 2019 12:55 PM)Flzduden Wrote:  Exactly what i mean! I won't need any response from the site in my application.

Anyways, does any of you know if it's possible to call a script (within html) from c#? And pass the temp with it?  😧

You should probably look into php if you're trying to execute scripts on the server
[Image: Syr3DlV.png]
Found this:




Now i just got to figure out how i'm going to pass my temps to it...


Possibly Related Threads...
Thread / Author Replies Views Last Post
[C] by F.A.S.TMar 9, 2019 06:16 PM 4 235 Mar 9, 2019 06:16 PM
Last Post: YouthInAsia
[.NET] by CrackIt™Dec 22, 2018 03:24 AM 1 142 Dec 22, 2018 03:24 AM
Last Post: itcorp
[C#] by TrinityAug 21, 2017 06:33 PM 23 1,093 Aug 21, 2017 06:33 PM
Last Post: DeadKube