Click here to Skip to main content
15,889,833 members
Home / Discussions / C#
   

C#

 
Generalusing gdi+ in mfc..problem Pin
yourbuddy7727-Jan-05 17:55
yourbuddy7727-Jan-05 17:55 
GeneralRe: using gdi+ in mfc..problem Pin
Dave Kreskowiak28-Jan-05 6:34
mveDave Kreskowiak28-Jan-05 6:34 
GeneralSocket question... [C# but not only] Pin
Daniele Mancini27-Jan-05 17:49
Daniele Mancini27-Jan-05 17:49 
GeneralRe: Socket question... [C# but not only] Pin
J4amieC27-Jan-05 22:25
J4amieC27-Jan-05 22:25 
GeneralRe: Socket question... [C# but not only] Pin
Daniele Mancini28-Jan-05 1:08
Daniele Mancini28-Jan-05 1:08 
GeneralRe: Socket question... [C# but not only] Pin
jzb27-Jan-05 23:55
jzb27-Jan-05 23:55 
GeneralRe: Socket question... [C# but not only] Pin
Daniele Mancini28-Jan-05 1:16
Daniele Mancini28-Jan-05 1:16 
GeneralRe: Socket question... [C# but not only] Pin
Member 132576628-Jan-05 16:45
Member 132576628-Jan-05 16:45 
i am also having problems with socket class.

i am creating a client/server using sockets (tcp Client and TCP listener) but i want to make it work over the internet bypassing a proxy server. is there any possible way that i could make my program run over the internet with this code?

thank you
<
//for my client class
try
{
ByPassProxy();
clientsocket = new TcpClient(serveraddress, serverport);
ns = clientsocket.GetStream();
sr = new StreamReader(ns);
connected = true;
}

public static void ByPassProxy()

{

HttpWebRequest request = (HttpWebRequest)WebRequest.Create("http://localhost:8080/STUFF//game.exe");
/*

GenerateGetOrPostRequest("http://localhost:8080/STUFF//game.exe",

"GET",

null);
*/


// add the proxy info

HwrAddProxy(request,"proxyaddress:port","username","password","domain");



// or set it up to go through the same proxy for all responses

Uri proxyURI = new Uri("proxy.dlsu.edu.ph:80");

GlobalProxySelection.Select = new WebProxy(proxyURI);

}



public static HttpWebRequest HwrAddProxy(HttpWebRequest httpRequest,

string proxyUri,

string proxyID,

string proxyPwd,

string proxyDomain)

{

if(httpRequest != null)

{

// create the proxy object

WebProxy proxyInfo = new WebProxy();

// add the address of the proxy server to use

proxyInfo.Address = new Uri(proxyUri);

// tell it to bypass the proxy server for local addresses

proxyInfo.BypassProxyOnLocal = true;

// add any credential information to present to the proxy server

proxyInfo.Credentials = new NetworkCredential(proxyID,

proxyPwd,

proxyDomain);

// assign the proxy information to the request

httpRequest.Proxy = proxyInfo;

}

// return the request

return httpRequest;

}

// for my server class

listener = new TcpListener(IpAddr[0],listenport);
Console.WriteLine(IpAddr[0].ToString());
listener.Start();
while (true)
{
try
{
Socket s = listener.AcceptSocket();
clientsocket = s;
clientservice = new Thread(new ThreadStart(ServiceClient));
clientservice.Start();
}
catch(Exception e)
{
Console.WriteLine(e.ToString() );
}




>
GeneralHELP pls!!!! Pin
Gregg Holter27-Jan-05 15:31
Gregg Holter27-Jan-05 15:31 
GeneralRe: HELP pls!!!! Pin
Yulianto.27-Jan-05 16:08
Yulianto.27-Jan-05 16:08 
GeneralRe: HELP pls!!!! Pin
Robert Rohde27-Jan-05 20:12
Robert Rohde27-Jan-05 20:12 
GeneralRe: HELP pls!!!! Pin
Daniele Mancini28-Jan-05 1:27
Daniele Mancini28-Jan-05 1:27 
GeneralRe: HELP pls!!!! Pin
Gregg Holter28-Jan-05 16:50
Gregg Holter28-Jan-05 16:50 
GeneralRe: HELP pls!!!! Pin
S. Senthil Kumar28-Jan-05 8:14
S. Senthil Kumar28-Jan-05 8:14 
GeneralRe: HELP pls!!!! Pin
Gregg Holter28-Jan-05 16:51
Gregg Holter28-Jan-05 16:51 
GeneralTreeview Pin
StephenMcAllister27-Jan-05 14:57
StephenMcAllister27-Jan-05 14:57 
GeneralRe: Treeview Pin
Robert Rohde27-Jan-05 20:14
Robert Rohde27-Jan-05 20:14 
GeneralValue of Custom Attribute on Enum Pin
Paul Watson27-Jan-05 14:08
sitebuilderPaul Watson27-Jan-05 14:08 
GeneralRe: Value of Custom Attribute on Enum Pin
leppie27-Jan-05 20:08
leppie27-Jan-05 20:08 
GeneralCrystal Report Deployment Problem.. Pin
Shady Aly27-Jan-05 13:05
Shady Aly27-Jan-05 13:05 
GeneralRe: Crystal Report Deployment Problem.. Pin
DougW4830-Jan-05 16:59
DougW4830-Jan-05 16:59 
GeneralCompile Problems Pin
thepersonof27-Jan-05 10:57
thepersonof27-Jan-05 10:57 
GeneralRe: Compile Problems Pin
thepersonof28-Jan-05 9:01
thepersonof28-Jan-05 9:01 
GeneralKilling applications Pin
Esmo200027-Jan-05 9:55
Esmo200027-Jan-05 9:55 
GeneralRe: Killing applications Pin
Dave Kreskowiak27-Jan-05 10:48
mveDave Kreskowiak27-Jan-05 10:48 

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.