|
fmlove wrote: and want to make its array i.e Item[] please help me....
Item[] item = { new Item(), new Item() }; This creates array with two items.
|
|
|
|
|
Colin Angus Mackay has given you the correct answer to your question above.
However, it's increasingly rare to need to have an array. Normally all we need is a collection in which case I'd recommend a generic list (from System.Collections.Generic).
public List<item> itemCollection = new List<item>();
You'll find that itemCollection has just about everything you'll need to manage the collection including the ToArray() method if you do need your items in an actual array.
Edit: damn these html tags screwing up the generics!
modified on Monday, October 6, 2008 8:35 AM
|
|
|
|
|
It's actually:
List<item> itemCollection = new List<item>();
I'm sure that's how you originally typed it, but you forgot to turn the pointy brackets into escaped characters.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
I got there in the end after about 4 edits. Chris could do with the auto html tag thing having some common exclusions built in.
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)
|
|
|
|
|
DaveyM69 wrote: Chris could do with the auto html tag thing having some common exclusions built in.
It's been suggested.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Hi,
I want to get all the IP Address of systems and others(ie,IP Cameras) connected in the Network through my system(ie Client device of the same network)
Thanks in Advance
Smitha
|
|
|
|
|
And the question is what exactly? Did you try to google for it??
Excellence is doing ordinary things extraordinarily well.
|
|
|
|
|
try downloading a sample of a chat application here in codeproject. All have that routine, it´s simply i really dont remember, you will find it at first look (often commented)
you should try also use "try catch" in your application to avoid unknown clients (with no ip) to connect to server
nelsonpaixao@yahoo.com.br
trying to help & get help
|
|
|
|
|
How do the filtering of files in the WebBrowser. NET? I wish they control does not availed image files jpg, gif, swf ...
|
|
|
|
|
Translation:
"ummmmmmmmm..."
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
You can get the text by using the WebBrowser.DocumentText property. Simply retrieve that data, liminate the stuff you want to filter, and set it back to the new version of the data.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
But how do you add a URL such as "http://gmail.com" is a WebBrowser retrieves the contents of the entire page with pictures (JPG, SWF ...). And I do not want to download them.
|
|
|
|
|
Use the WebClient class to retrieve the page, massage the returned html, and set the WebBrowser.DocumentText property to the massaged URL.
using System.Net;
string url = "http://www.mywebpage.com/";
Uri uri = new Uri(url);
WebClient webClient = new WebClient();
string response = "";
try
{
response = webClient.DownloadString(uri);
}
catch (Exception e)
{
if (e != null) { }
}
this.webBrowser1.Navigate("about:blank");
HtmlDocument doc = this.webBrowser1.Document;
doc.Write(string.Empty);
this.webBrowser1.DocumentText = ProcessWebPage(response);
ProcessWebPage would be a function you write to filter the results. You gotta learn to think around problems instead of through them.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
OK. Thank you!
But the matter is this:
[Code C #]
webBrowser1.Navigate (new Uri ( "http://gmail.com"));
HtmlDocument doc = webBrowser1.Document;
doc.GetElementById ( "Email"). setAttribute ( "value", "login");
doc.GetElementById ( "passwd"). setAttribute ( "value", "password");
doc.GetElementById ( "signIn"). InvokeMember ( "Click");
I have to move to a new address in the WebBrowser. WebBrowser must parse page. JavaScrypt process. And so to avoid manual transmission parameters POST and GET. In WebClient i must manual set parameters POST and GET. Sometime it is very difficult.
|
|
|
|
|
If you're going to continue to feed me requirements piece-meal like this, I'm done with trying to help you.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Hi,
I want to create a batch file that should run 3 different .exe that are placed in a single folder and the location of the folder could be anywhere in the system. Is there a command in batch file that allows me to run the .exe from their current location? Please help
Cheers!
Ethen
|
|
|
|
|
Googe the Process class.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Hello World...
I want to connect to a sql server 2000 db remotely(Lan Network).
I write a c# test project and set server, my server IP but after run it ,give me this error: Time out, your server computer not response.
I beleve, i must to configure my server sqlserver but ...!!!???
sry for my very bad en...
TanX World...
|
|
|
|
|
I think it is because of your ConnectionString, do you addressed your SqlDB correctly, in ConnectionString?
While (true) { Human.isLearnable = true; }
|
|
|
|
|
my connectionstring is corrent because when I change my server Name to (local) my app haven't any error...
...
|
|
|
|
|
Basically three possibilities:
1. Your SQL Server isn't configured to use TCP/IP, use Configuration Manager at server
2. Your connection string is faulty, bad ip-address, port etc
3. IP traffic isn't routed to server, for example because of an firewall
The need to optimize rises from a bad design
|
|
|
|
|
- In sqlserver I see tcp/ip connection & I ticked it...
- If my connectionstring faulty ,i can not connect with it localy...
my connectionstring:
public void Connect()
{
string cs = "Server = 192.168.10.190; database = DB1; user=u1; password=123";
con.ConnectionString = cs;
con.Open();
}
|
|
|
|
|
Few questions:
- is the SQL Server running on the same computer where you're running the app?
- if you can connect to it locally but not remotely, what's the difference in connection string?
The need to optimize rises from a bad design
|
|
|
|
|
diference of it , is i change servername to (local)...
I have some pc with Lan network in one of these I have sqlserver with my database, and in other pcs i have app for connect to that.
|
|
|
|
|
Then the three choices I listed are most common reasons. It's a very different situation to use IP than to connect to localhost.
Few things you should check,
- try to ping the IP-address
- check on server side that the listening port is 1433 or if it isn't, specify the correct port in connection string
- check on server side that the other pc can listen to port 1433 (no Windows firewall blocking)
- check that it isn't a named instance on the server or if it is, specify the instance name in connection string
The need to optimize rises from a bad design
|
|
|
|