|
Hi All,
I would like to connect to a server through TcpClient class.
As I'm going through ISA Proxy which requires a NTLM authentication, I want to know how do I associate webproxy class with tcpclient (if thats possible).
I could do something like this with WebRequest class,
<br />
WebRequest objRequest = WebRequest.Create("http://www.someurl.com/abc.xml"); <br />
objRequest.Proxy = System.Net.WebProxy.GetDefaultProxy();<br />
objRequest.Proxy.Credentials = System.Net.CredentialCache.DefaultCredentials;<br />
WebResponse objResponse = objRequest.GetResponse();<br />
but how do I do the same with TcpClient, I could not find a way to associate a proxy with TcpClient class.
I tried with
<br />
_socket = new TcpClient("http://www.google.com", port); <br />
for which i got the message saying host not found.
Thanks a lot.
Cheers
Kannan
|
|
|
|
|
I have created an OCX that contains a CArray of doubles
When I add the OCX to a Dialog in a VC6 project, the CArray memory is destroyed correctly on destruction.
When I add the same OCX to a form in a C# .NET project the debugger reports a memory leak for the CArray.
Why is the CArray memory not being destroyed on the OCX destruction?
The doubles are added to the CArray by value.
|
|
|
|
|
both are different, right? just as c++ and visual c++.
what i have seen is C# is for console applications, why Visual C# is not as popular as c#?
Tell me some good book for Visual C#.
@ish@
|
|
|
|
|
Aisha Ikram wrote:
what i have seen is C# is for console applications, why Visual C# is not as popular as c#?
hmmmm is that so?...i don't think there is any difference.
Aisha Ikram wrote:
Tell me some good book for Visual C#.
Inside C# by Tom Archer, Microsoft Press
(Good for learning the language)
Professional C#, Wrox Press
(Covers the base class libraries as well)
May the Source be with you
Sonork ID 100.9997 sijinjoseph
|
|
|
|
|
Sijin, thanks for recommending the books .
Sijin wrote:
hmmmm is that so?...i don't think there is any difference.
Well that was just an idea, i was not really sure. but yes you are right, no difference except that Visual C# provides wizards and win forms like things.
@ish@
- When there is a will there is a way
|
|
|
|
|
As Sijin said there isn't any difference in the language.
C# is the language, Visual C# is a product produced by Microsoft which includes an IDE to help make the writing of C# programs faster. VC# includes a forms designer, as well as some wizards that will generate code.
James
- out of order -
|
|
|
|
|
Finally you shot down that bloody sig. At a time I thought exposing an annoying sig and evangelizing .NET at the same time was just too much wrong for a single guy.
Back to real work : D-17.
|
|
|
|
|
And depending on your viewpoint I can add to that by being a right-wing conservative
James
- out of order -
|
|
|
|
|
<sarcasm> That's horrible!</sarcasm>
This message was paid in part by the Republican National Commitee
You will now find yourself in a wonderous, magical place, filled with talking gnomes, mythical squirrels, and, almost as an afterthought, your bookmarks
-Shog9 teaching Mel Feik how to bookmark
I don't know whether it's just the light but I swear the database server gives me dirty looks everytime I wander past.
-Chris Maunder
|
|
|
|
|
Politics are for people that cant code
"I dont have a life, I have a program."
|
|
|
|
|
Bah! Spoken like a true member of the Green Party!;P
You will now find yourself in a wonderous, magical place, filled with talking gnomes, mythical squirrels, and, almost as an afterthought, your bookmarks
-Shog9 teaching Mel Feik how to bookmark
I don't know whether it's just the light but I swear the database server gives me dirty looks everytime I wander past.
-Chris Maunder
|
|
|
|
|
Yeah! Me and me mate Dave from Staines I!
"I dont have a life, I have a program."
|
|
|
|
|
|
Hi,All!
I created users control inherited from TextBox.
And I added new validator
this.Validating += new System.ComponentModel.CancelEventHandler(maskedValidating);
When I'm closing form where that control used,
the maskedValidating raising, and form don't closed while maskedValidating is false.
Question is:
if I'm closing a form so I needn't to invoke that validating
How I can teach that control to undestand that situation.
Thank.
shab
|
|
|
|
|
Is there any way to change the color of header in a ListView. Any C# Guru can help me in this matter I will be really thankful.
|
|
|
|
|
Hi!
I'm having a problem with the HttpWebRequest - when I recieve the stream it looses the ÅÄÖ (and some other...).
The Code:
HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create ("http://www.dvdforum.nu");
HttpWebResponse response = (HttpWebResponse)request.GetResponse ();
StreamReader reader = new StreamReader (response.GetResponseStream ());
StreamWriter writer = new StreamWriter ("google.html");
string buffer = "";
while ((buffer = reader.ReadLine ()) != null)
{
writer.WriteLine (buffer);
}
reader.Close ();
writer.Close ();
System.Diagnostics.Process.Start ("google.html");
Any idea how to fix this?
Andreas Philipson
|
|
|
|
|
You need to provide an System.Text.Encoder to StreamReader and StreamWriter to handle the conversion from bytes to chars (it's not the same thing in .NET).
Which one will be some guesswork, but they are only 4 or 5.
lazy isn't my middle name.. its my first.. people just keep calling me Mel cause that's what they put on my drivers license. - Mel Feik
|
|
|
|
|
That was my first thought too, but none will give the right result
Andreas Philipson
|
|
|
|
|
Try:
StreamReader reader = new StreamReader(response.GetResponseStream(), Encoding.GetEncoding("iso-8859-1"));
|
|
|
|
|
When I double click a ListViewItem it's automaticaly checked. How can I disable this ?
By default if you single-click any item it becomes selected, but not checked. If you double-click a single item, it becomes selected and checked, and all previously checked items remain checked.
-- Ingram
|
|
|
|
|
I learned from my own question and had to to override the WinProc method to handle the double click message that is sent to the list control.
This prevents the checkbox from being checked from double-clicks, which is more natural in my opinion, just as it is in TreeView.
This might be a good beginner article, since I had no idea what WinProc was until today.
using System;
using System.Windows.Forms;
using System.Diagnostics;
using System.ComponentModel;
namespace MyTestListView
{
[ToolboxItem(false)]
public class MyListView : System.Windows.Forms.ListView
{
private const int WM_LBUTTONDBLCLK = 0x0203;
#region Constructors
public MyListView()
{
}
#endregion
#region Overrides
protected override void WndProc(ref Message message)
{
switch (message.Msg)
{
case (int)Msg.WM_LBUTTONDBLCLK:
{
Debug.WriteLine("Double-Clicked");
} break;
default:
{
base.WndProc(ref message);
} break;
}
#endregion
}
}
}
-- Ingram
|
|
|
|
|
When I compile the .cs file, I found following mistake: The type or namespace name 'DocumentNavigator' could not be found (are you missing a using
directive or an assembly reference?)
Is there anyone know how to solve this problem??
|
|
|
|
|
Actually, the answer to your question is right in the error message. The compiler doesn't know where to find "DocumentNavigator". In C++ you would tell it how by using a #include. In C# you do this by typing in the full namespace for DocumentNavigator, or by a "using" statement that references the namespace where you find DocumentNavigator. (Check MSDN help to find out where it is if you don't already know.)
John
|
|
|
|
|
Is it possible to use COM+ object pooling with .Net remoting. I mean can i have a remote object that is pooled by COM+
Help me James .T
May the Source be with you
Sonork ID 100.9997 sijinjoseph
|
|
|
|
|
Sijin wrote:
Help me James .T
I don't know enough about COM+ to help you there. You might want to check the DOTNET and DOTNET-CLR archives to see if someone else has asked the same question.
DevelopMentor's mailing list homepage[^]
James
- out of order -
|
|
|
|