Program/website interaction. Tutorials needed

So a few days ago I had this little idea that it would be funny if I could let a program automatically vote a set number of times using proxies on strawpoll.me

I know there is a dubious tool for it and that there are more sophisticated ones being developed but I wanna do my one little project to learn by doing.

I am not a very experienced programmer. I just about know the basics of object-oriented programming so I am a little lost with a number of things dispite the concept being simple.

To avoid misunderstandings, here is how I imagine the program working: A little window to insert the/number for the strawpoll site to be voted on. aditionally a path to a .txt containing a list of proxies(realistically Im not going to touch automated proxysearch just yet). Also it obviously needs something to specify which option to actually vote for. the program then parses the list of proxies, voting once for each and it maybe even has a progress bar and returns errors for unresponsive proxies.

Here is what I have problems with: I dont know how to have the program "interpret" the website or how to interpret it myself to know hat inquiries I have to send to the site to tell it vote for "…" also how to send it via proxy.

The whole thing seems very confusing which – to finally get to the point- is why I am asking for some help, most preferably in the form of tutorial links that lead me to understanding program/website interaction step by step to a point where I can use it.

by Adenylatcyclase via /r/csharp

How would one go about parsing this?

I am in the process of creating a console application that connects via WebSocket to /r/thebutton's ticking timer to write what the timer is currently at to the console. However, Json.Net is seemingly unable to parse the WebSocket data, as only blank lines are written and json2csharp states that it is invalid Json.

And so, I ask you, what this mystery (likely incredibly obvious) format is.

{{"type": {"ticking", "payload": {"participants_text": "784,572", "tick_mac":"b6f5371144facb1f7f26f6d328dc5576e340b4a3", "seconds_left":43.0, "now_str": "2015-04-19-05-22-55"}} 

by ___Locke____ via /r/csharp

Is there a JavaScript The Good Parts equivalent for C# ?

I was looking at books on amazon and sort of settled on these two:

http://ift.tt/1JUxVQq

http://ift.tt/1yG2yry

The first one sounds like it'd be a good equivalent but the reviews seem to indicate it's way more a dry reference than anything else. The latter one sounds a bit too beginner-y (i.e. "Let's learn about if statements!")

Just to throw it out there I am looking specifically for a physical book. I don't know why but I like my educating to be off of dead trees.

by YopparaiNeko via /r/csharp

Question about strings

How can a script detect part of a string instead of the whole thing?

One example is when you send an email and the text includes " is attached " but you don't have file attached, the program will detect that and give you a warning. How can you do something similar in c#?

by lambmeow via /r/csharp

Looking for a good C# teaching site

I know the basics of the language (variables, if/else, input and output, lists,array, class etc..) But I really want to learn this language more in depth. I learned the basic stuff I mentioned from YouTube videos and a couple of sites. I am looking for a new site to learn from because those I learned from don't explain well to me the language after the basic stuff. I'm looking for a site with the teaching style of Code Academy (an interactive teaching site) but any other GOOD (in your opinion) site would be great as well. Thanks

by RoeiRDT via /r/csharp

First C# Project

I've just gone through the Head First C# book. I've now started on my own project. What I want to do is make a pilot file editor for the old X-Wing game. I use to edit my pilot files with a hex editor. I figure this would be a small enough project to get my feet wet with.

I'm reading in the data from the pilot file with the following method. This works fine and I get the whole thing in a byte array.

void openToolStripButton_Click(object sender, EventArgs e) { openFileDialog1.FileName = ""; openFileDialog1.Filter = "Pilot Files (*.plt)|*.plt"; openFileDialog1.CheckFileExists = true; openFileDialog1.CheckPathExists = true; if (openFileDialog1.ShowDialog() == DialogResult.OK) { fileName = openFileDialog1.FileName; bytes = File.ReadAllBytes(fileName); pilot.GetData(fileName, bytes); } UpdateForm(); } 

I am now building a class called Pilot that I will map that data to so the user can change the values that they want to and then write that back to the file on disk. There are a lot of individual values available for editing. I'm mapping them in one by one. The code is getting rather long and repetitive and it's got me thinking their might be a more efficient way of doing the mapping. Any suggestions?

This is what my Pilot class looks like so far:

class Pilot { // Pilot data fields public string PltName { get; set; } public Health PltHealth { get; set; } public Rank PltRank { get; set; } public uint PltTODScore { get; set; } public uint PltRookieNum { get; set; } //experience level - rookie to top ace public int PltXWingTrainingCompleted { get; set; } public int PltYWingTrainingCompleted { get; set; } public int PltAWingTrainingCompleted { get; set; } public int PltBWingTrainingCompleted { get; set; } public uint PltXWingTrainingScore { get; set; } public uint PltYWingTrainingScore { get; set; } public uint PltAWingTrainingScore { get; set; } public uint PltBWingTrainingScore { get; set; } public bool PltXWingHistComplete1 { get; set; } public bool PltXWingHistComplete2 { get; set; } public bool PltXWingHistComplete3 { get; set; } public bool PltXWingHistComplete4 { get; set; } public bool PltXWingHistComplete5 { get; set; } public bool PltXWingHistComplete6 { get; set; } public bool PltYWingHistComplete1 { get; set; } public bool PltYWingHistComplete2 { get; set; } public bool PltYWingHistComplete3 { get; set; } public bool PltYWingHistComplete4 { get; set; } public bool PltYWingHistComplete5 { get; set; } public bool PltYWingHistComplete6 { get; set; } public bool PltAWingHistComplete1 { get; set; } public bool PltAWingHistComplete2 { get; set; } public bool PltAWingHistComplete3 { get; set; } public bool PltAWingHistComplete4 { get; set; } public bool PltAWingHistComplete5 { get; set; } public bool PltAWingHistComplete6 { get; set; } public bool PltBWingHistComplete1 { get; set; } public bool PltBWingHistComplete2 { get; set; } public bool PltBWingHistComplete3 { get; set; } public bool PltBWingHistComplete4 { get; set; } public bool PltBWingHistComplete5 { get; set; } public bool PltBWingHistComplete6 { get; set; } public Pilot() { PltName = "No Pilot File Loaded"; PltHealth = Health.Alive; PltRank = Rank.Cadet; PltTODScore = 0; PltRookieNum = 0; PltXWingTrainingCompleted = 0; PltYWingTrainingCompleted = 0; PltAWingTrainingCompleted = 0; PltBWingTrainingCompleted = 0; PltXWingTrainingScore = 0; PltYWingTrainingScore = 0; PltAWingTrainingScore = 0; PltBWingTrainingScore = 0; PltXWingHistComplete1 = false; PltXWingHistComplete2 = false; PltXWingHistComplete3 = false; PltXWingHistComplete4 = false; PltXWingHistComplete5 = false; PltXWingHistComplete6 = false; PltYWingHistComplete1 = false; PltYWingHistComplete2 = false; PltYWingHistComplete3 = false; PltYWingHistComplete4 = false; PltYWingHistComplete5 = false; PltYWingHistComplete6 = false; PltAWingHistComplete1 = false; PltAWingHistComplete2 = false; PltAWingHistComplete3 = false; PltAWingHistComplete4 = false; PltAWingHistComplete5 = false; PltAWingHistComplete6 = false; PltBWingHistComplete1 = false; PltBWingHistComplete2 = false; PltBWingHistComplete3 = false; PltBWingHistComplete4 = false; PltBWingHistComplete5 = false; PltBWingHistComplete6 = false; } public void GetData(string fileName, byte[] bytes) { PltName = Path.GetFileNameWithoutExtension(fileName); PltHealth = (Health)bytes[2]; PltRank = (Rank)bytes[3]; PltTODScore = BitConverter.ToUInt32(bytes,4); PltRookieNum = BitConverter.ToUInt16(bytes, 8); PltXWingTrainingCompleted = bytes[134]; PltYWingTrainingCompleted = bytes[135]; PltAWingTrainingCompleted = bytes[136]; PltBWingTrainingCompleted = bytes[137]; PltXWingTrainingScore = BitConverter.ToUInt32(bytes, 38); PltYWingTrainingScore = BitConverter.ToUInt32(bytes, 42); PltAWingTrainingScore = BitConverter.ToUInt32(bytes, 46); PltBWingTrainingScore = BitConverter.ToUInt32(bytes, 50); PltXWingHistComplete1 = Convert.ToBoolean(bytes[544]); PltXWingHistComplete2 = Convert.ToBoolean(bytes[545]); PltXWingHistComplete3 = Convert.ToBoolean(bytes[546]); PltXWingHistComplete4 = Convert.ToBoolean(bytes[547]); PltXWingHistComplete5 = Convert.ToBoolean(bytes[548]); PltXWingHistComplete6 = Convert.ToBoolean(bytes[549]); PltYWingHistComplete1 = Convert.ToBoolean(bytes[560]); PltYWingHistComplete2 = Convert.ToBoolean(bytes[561]); PltYWingHistComplete3 = Convert.ToBoolean(bytes[562]); PltYWingHistComplete4 = Convert.ToBoolean(bytes[563]); PltYWingHistComplete5 = Convert.ToBoolean(bytes[564]); PltYWingHistComplete6 = Convert.ToBoolean(bytes[565]); PltAWingHistComplete1 = Convert.ToBoolean(bytes[576]); PltAWingHistComplete2 = Convert.ToBoolean(bytes[577]); PltAWingHistComplete3 = Convert.ToBoolean(bytes[578]); PltAWingHistComplete4 = Convert.ToBoolean(bytes[579]); PltAWingHistComplete5 = Convert.ToBoolean(bytes[580]); PltAWingHistComplete6 = Convert.ToBoolean(bytes[581]); PltBWingHistComplete1 = Convert.ToBoolean(bytes[592]); PltBWingHistComplete2 = Convert.ToBoolean(bytes[593]); PltBWingHistComplete3 = Convert.ToBoolean(bytes[594]); PltBWingHistComplete4 = Convert.ToBoolean(bytes[595]); PltBWingHistComplete5 = Convert.ToBoolean(bytes[596]); PltBWingHistComplete6 = Convert.ToBoolean(bytes[597]); } } 

by LordDrakken via /r/csharp