Click here to Skip to main content
15,887,313 members
Home / Discussions / C#
   

C#

 
QuestionApplication.Run(new FormMain()); does not contain a constructor that takes 0 arguments Pin
jkirkerx9-Apr-15 7:02
professionaljkirkerx9-Apr-15 7:02 
AnswerRe: Application.Run(new FormMain()); does not contain a constructor that takes 0 arguments Pin
Richard Deeming9-Apr-15 7:05
mveRichard Deeming9-Apr-15 7:05 
GeneralRe: Application.Run(new FormMain()); does not contain a constructor that takes 0 arguments Pin
jkirkerx9-Apr-15 7:24
professionaljkirkerx9-Apr-15 7:24 
AnswerRe: Application.Run(new FormMain()); does not contain a constructor that takes 0 arguments Pin
OriginalGriff9-Apr-15 21:47
mveOriginalGriff9-Apr-15 21:47 
GeneralRe: Application.Run(new FormMain()); does not contain a constructor that takes 0 arguments Pin
jkirkerx10-Apr-15 6:24
professionaljkirkerx10-Apr-15 6:24 
GeneralRe: Application.Run(new FormMain()); does not contain a constructor that takes 0 arguments Pin
OriginalGriff10-Apr-15 6:32
mveOriginalGriff10-Apr-15 6:32 
GeneralRe: Application.Run(new FormMain()); does not contain a constructor that takes 0 arguments Pin
jkirkerx10-Apr-15 7:36
professionaljkirkerx10-Apr-15 7:36 
QuestionParse XML Sibling Pin
antrock1019-Apr-15 6:23
antrock1019-Apr-15 6:23 
Hello,

I'm using a website to parse data to my program and I return the node I want and add it to a listbox. In this case I am looking for "GameTitle". "GameTitle" has a sibling called "id". Once a "GameTitle" is selected in the listbox I would like to pass the id to a variable called "id". I am a bit stuck now and would appreciate some help.

Snippet of XML
<Data>
<baseImgUrl>http://thegamesdb.net/banners/</baseImgUrl>
<Game>
<id>5016</id>
<GameTitle>Final Fight</GameTitle>
<PlatformId>21</PlatformId>
<Platform>Sega CD</Platform>
<ReleaseDate>07/01/1993</ReleaseDate>
<Overview>
The Sega Mega CD version, titled Final Fight CD, was ported and published by Sega under license from Capcom in 1993. This version retains nearly all the features of the arcade game (namely the 2-player game mode, the Industrial Area stage, and the ability to play as any of the three main characters), adding voice acting to the game's opening and ending sequence, an arranged version of the original soundtrack, and an exclusive time attack mode. The Mega CD version was still censored for the English localization with many of the same changes. Poison and Roxy were kept this time, but were redrawn with less revealing clothing (longer shorts and shirts) to hide all nudity
</Overview>
<Genres>
<genre>Fighting</genre>
</Genres>
<Co-op>No</Co-op>
<Publisher>Sega</Publisher>
<Developer>Sega</Developer>
<Images>
<fanart>
<original width="1920" height="1080">fanart/original/5016-1.jpg</original>
<thumb>fanart/thumb/5016-1.jpg</thumb>
</fanart>
<boxart side="back" width="1530" height="2156" thumb="boxart/thumb/original/back/5016-1.jpg">boxart/original/back/5016-1.jpg</boxart>
<boxart side="front" width="1539" height="2156" thumb="boxart/thumb/original/front/5016-1.jpg">boxart/original/front/5016-1.jpg</boxart>
<clearlogo width="400" height="250">clearlogo/5016.png</clearlogo>
</Images>
</Game>

My Code Snippet
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Xml;
using System.Collections;
using System.IO;
using System.Xml.Linq;
using System.Net;
namespace Collection
{
    public partial class search : Form
    {
        ArrayList ar;
        String Search_Query;
        public string id;
        public string selectedGame;

        public search()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            Search_Query = textBox1.Text;
            URL_XML_Load();
        }

        public void URL_XML_Load()
        {

            XmlDocument doc = new XmlDocument();
            doc.Load("<a href="http://thegamesdb.net/api/GetGame.php?name=">http://thegamesdb.net/api/GetGame.php?name=</a>" + Search_Query);

            foreach (XmlNode node in doc.ChildNodes)
            {
                if (node.Name == "Data")
                {
                    foreach (XmlNode node_of_node in node.ChildNodes)
                    {
                        if (node_of_node.Name == "Game")
                        {
                            string Name = node_of_node["GameTitle"].InnerText;
                            listBox1.Items.Add(Name);

                        }

                    }
                }

            }
        }

        private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
        {
            selectedGame = listBox1.SelectedItem.ToString();

        }

AnswerRe: Parse XML Sibling Pin
Richard Deeming9-Apr-15 6:39
mveRichard Deeming9-Apr-15 6:39 
GeneralRe: Parse XML Sibling Pin
antrock1019-Apr-15 9:22
antrock1019-Apr-15 9:22 
GeneralRe: Parse XML Sibling Pin
Richard Deeming9-Apr-15 10:02
mveRichard Deeming9-Apr-15 10:02 
AnswerRe: Parse XML Sibling Pin
surya tri13-Apr-15 2:21
surya tri13-Apr-15 2:21 
Questiongenerate a sequence of number prefixed with a character Pin
Jimmy-IN8-Apr-15 23:17
Jimmy-IN8-Apr-15 23:17 
AnswerRe: generate a sequence of number prefixed with a character Pin
Freak308-Apr-15 23:26
Freak308-Apr-15 23:26 
AnswerRe: generate a sequence of number prefixed with a character Pin
Pete O'Hanlon8-Apr-15 23:29
mvePete O'Hanlon8-Apr-15 23:29 
GeneralRe: generate a sequence of number prefixed with a character Pin
Jimmy-IN8-Apr-15 23:35
Jimmy-IN8-Apr-15 23:35 
GeneralRe: generate a sequence of number prefixed with a character Pin
Eddy Vluggen9-Apr-15 0:23
professionalEddy Vluggen9-Apr-15 0:23 
AnswerRe: generate a sequence of number prefixed with a character Pin
V.9-Apr-15 2:08
professionalV.9-Apr-15 2:08 
QuestionGet listbox text to show in richtextbox + custom text Pin
Googooli868-Apr-15 22:52
Googooli868-Apr-15 22:52 
Answer[REPOST] Pin
Sascha Lefèvre8-Apr-15 23:35
professionalSascha Lefèvre8-Apr-15 23:35 
QuestionHow do I filter PPID between oPsType.PPIDFrom and oPsType.PPIDTo, and pay_type in oPsType.PAY_TYPE Pin
Member 115045458-Apr-15 9:42
Member 115045458-Apr-15 9:42 
AnswerRe: How do I filter PPID between oPsType.PPIDFrom and oPsType.PPIDTo, and pay_type in oPsType.PAY_TYPE Pin
Mycroft Holmes8-Apr-15 14:19
professionalMycroft Holmes8-Apr-15 14:19 
QuestionToday's Async Question #2 Pin
Kevin Marois8-Apr-15 8:35
professionalKevin Marois8-Apr-15 8:35 
QuestionAnother Async Question Pin
Kevin Marois8-Apr-15 8:18
professionalKevin Marois8-Apr-15 8:18 
AnswerRe: Another Async Question PinPopular
Richard Deeming8-Apr-15 8:27
mveRichard Deeming8-Apr-15 8:27 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.