Kikisss Posted September 1, 2010 Report Share Posted September 1, 2010 (edited) Sveiki. Kā es varu iedabūt, lai adreses beigās ieliekās uzģenerētais skaitlis, kas ir int? webBrowser1.Navigate("http://www.xxxxxxxx.lv/?id="); Edited September 1, 2010 by Kikisss Quote Link to comment Share on other sites More sharing options...
briedis Posted September 1, 2010 Report Share Posted September 1, 2010 (edited) webBrowser1.Navigate("http://www.xxxxxxxx.lv/?id=" & skaitlis); ? Kur tas ģenerētais skaitlis rodas? Edited September 1, 2010 by briedis Quote Link to comment Share on other sites More sharing options...
Kikisss Posted September 1, 2010 Author Report Share Posted September 1, 2010 (edited) webBrowser1.Navigate("http://www.xxxxxxxx.lv/?id=" & skaitlis); ? Kur tas ģenerētais skaitlis rodas? private void btn3_Click(object sender, EventArgs e) { counter++; } Bet tāpat izmet error... Operator '&' cannot be applied to operands of type 'string' and 'int' bet ja pieliek skaitlis.ToString tad- Error 1 Operator '&' cannot be applied to operands of type 'string' and 'method group' Edited September 1, 2010 by Kikisss Quote Link to comment Share on other sites More sharing options...
briedis Posted September 1, 2010 Report Share Posted September 1, 2010 (edited) Hmm, nu kur ir problēma? Nodefinēt klases mainīgo, vai piekabināt stringam klāt mainīgo? Ok, kāds simbols tiek izmantots C# lai apvienotu stringus? (biju domājis ka &, jo VB.nET tā ir) Edit: izmanto + zīmi... Edited September 1, 2010 by briedis Quote Link to comment Share on other sites More sharing options...
Kikisss Posted September 1, 2010 Author Report Share Posted September 1, 2010 (edited) Hmm, nu kur ir problēma? Nodefinēt klases mainīgo, vai piekabināt stringam klāt mainīgo? Ok, kāds simbols tiek izmantots C# lai apvienotu stringus? (biju domājis ka &, jo VB.nET tā ir) Edit: izmanto + zīmi... Paldies. Ar + sanāca Edited September 1, 2010 by Kikisss Quote Link to comment Share on other sites More sharing options...
bubu Posted September 1, 2010 Report Share Posted September 1, 2010 Vispār jau C# nav pārlūku valoda. Un atbilde tavam jautājumam ir (ja id ir skaitliska tipa mainīgais): webBrowser1.Navigate(String.Format("http://www.xxxxxxxx.lv/?id=%1", id)); vai webBrowser1.Navigate("http://www.xxxxxxxx.lv/?id=" + id.ToString()); vai arī vienkārši +, ja id ir string tipa mainīgais: webBrowser1.Navigate("http://www.xxxxxxxx.lv/?id=" + id); Jebkurā C# pamatu grāmatā/pamācībā, tas ir rakstīts. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.