|
|
|
The answer often comes to me straight after posting too!
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Expect everything to be hard and then enjoy the things that come easy. (code-frog)
|
|
|
|
|
Hey,
What is the simplest way to get a website IP Address in C#??
Thanx!
All generalizations are wrong, including this one!
(\ /)
(O.o)
(><)
|
|
|
|
|
Is this what you mean?
System.Net.Dns.GetHostByName( "www..." );
edit: apparently GetHostByName is obsolete - use GetHostEntry now
----------------------------------
Be excellent to each other
modified on Monday, September 15, 2008 6:02 AM
|
|
|
|
|
Thanks! I needed something as simple but I still cant see the ip address!!
I tried
public static string GetWebsiteIP(string websiteName)
{
IPHostEntry host;
string strIP = String.Empty;
host = Dns.GetHostEntry(websiteName);
foreach (IPAddress ip in host.AddressList)
strIP += ip.ToString();
return strIP;
}
But I still get the website name I pass
GetWebsiteIP("www.codeproject.com");
All generalizations are wrong, including this one!
(\ /)
(O.o)
(><)
|
|
|
|
|
Works fine for me : returns 69.10.233.10
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Expect everything to be hard and then enjoy the things that come easy. (code-frog)
|
|
|
|
|
Did you try my very same code to get the IP address?? nothing is changed??
All generalizations are wrong, including this one!
(\ /)
(O.o)
(><)
|
|
|
|
|
Funny! Ok, it works now, maybe I needed to clean the solution and rebuild..
Thanks for your help guys!
All generalizations are wrong, including this one!
(\ /)
(O.o)
(><)
|
|
|
|
|
Just tried it and it works for me
Also, a domain name can map to multiple IP addresses, so you might want to return a string[] , or maybe just pick the first one?
----------------------------------
Be excellent to each other
|
|
|
|
|
Funny! Ok, it works now, maybe I needed to clean the solution and rebuild..
Thanks for your help!
All generalizations are wrong, including this one!
(\ /)
(O.o)
(><)
|
|
|
|
|
i'm trying to add a user into the ACL of a directory. i can do this fine for the user who is logged on but can't find a way of doing this for any other user in the domain.
does anyone know how to find a domain users SID?
|
|
|
|
|
Hi mister,
I have an Winforms app (Client) and Web app + WCF Services + Windows Services (Server). In server, I have installed SQL SERVER 2000.
Now, I want create a installer (MSI.exe or another Winforms app) to create a database, perhaps user, tables, stored procedures, .. Only the user introduces name of database, server, and if has Windows authentication; if not Windows authentication, I need user and password.
I have several scripts SQL, that I need execute too. If I use isql command I have problmes with codification because my scripts sql have Spanish characters. I tested with using ANSI and UTF-8 encoding for scripts .sql files, but didn't work.
Finally, how I can create this installer ? is it better MSI ?? or can I create an WinForms app ??
Any sample will be very very grateful.
Thanks in advance.
AE
|
|
|
|
|
alhambra-eidos wrote: Any sample will be very very grateful.
Try google. There's bound to be loads of samples out there.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
hi
how can i fix this problem in my connection string ?
LocalConnection = new SqlConnection("data source=localhost;database=Alarms;Integrated Security=True");
it will fixed when i substitute "localhost" with ".\\sqlexpress"
i want to work with sqlServer 2005 not sqlexpress
the error is:
An error has occurred while establishing a connection to the server.
When connecting to SQL Server 2005, this failure may be caused by the fact that
under the default settings SQL Server does not allow remote connections.
(provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)
|
|
|
|
|
check this http://www.connectionstrings.com/[^]
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
If my post helps you kindly save my time by voting my post.
|
|
|
|
|
Use
\\ComputerName\SQL2005ServerName insteed of localhost
|
|
|
|
|
hi
how can i call a static method declared in Form1 from business_logic layer
i can call business_logic layer methods from Form1 because :
-------------------form1------------------
using business_logic
------------------------------------
but cannot see form1 methods from business_logic layer because :
----------------- business_logic layer ------------------------
using form1 //does not allowed because of circular dependency
-----------------------------------------------
so what can i do ?
|
|
|
|
|
Take the slightly longer way around, inside business_logic use myNamespace.form1.myMethod
My current favourite word is: Nipple!
-SK Genius
Game Programming articles start - here[ ^]-
|
|
|
|
|
i want to add a new line to a text box.
txtstate.multiline = true
txtstate.text+= "\n";
or
txtstate.appendtext("\n");
doesn't work. all he texts are displayed in the same line.
|
|
|
|
|
Use –
"\r\n"
This should give you a new line.
-Dave.
------------------------------------
http://www.componentone.com
------------------------------------
|
|
|
|
|
you need to use \r\n (carriage return and newline)
|
|
|
|
|
|
Environment.NewLine
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Expect everything to be hard and then enjoy the things that come easy. (code-frog)
|
|
|
|
|
I searched and found out that in VC++ 2008 can use this
textBox1.Text = "Line One";
textBox1.Text += Environment::NewLine;
textBox1.Text += "Line Two";
Hope it help you!
|
|
|
|