Click here to Skip to main content
15,916,398 members
Home / Discussions / C#
   

C#

 
GeneralRe: How to set Image in particular cell in DataGridView in C# Pin
Sunil G9-Jul-10 21:18
Sunil G9-Jul-10 21:18 
AnswerRe: How to mearge 2 column in dagagridview in C# application?? Pin
Peace ON9-Jul-10 21:20
Peace ON9-Jul-10 21:20 
GeneralRe: How to mearge 2 column in dagagridview in C# application?? Pin
Sunil G9-Jul-10 21:27
Sunil G9-Jul-10 21:27 
QuestionStore /Retrieve Text in file Pin
annmarypaul9-Jul-10 11:51
annmarypaul9-Jul-10 11:51 
AnswerRe: Store /Retrieve Text in file Pin
PIEBALDconsult9-Jul-10 12:47
mvePIEBALDconsult9-Jul-10 12:47 
AnswerRe: Store /Retrieve Text in file Pin
Peace ON9-Jul-10 19:16
Peace ON9-Jul-10 19:16 
AnswerRe: Store /Retrieve Text in file Pin
Abhinav S9-Jul-10 19:51
Abhinav S9-Jul-10 19:51 
Questionhttpwebrequest getResponse( ) freezes my program Pin
jasonneverland9-Jul-10 5:14
jasonneverland9-Jul-10 5:14 
I was trying to use httpwebrequest to use a rest like service on a remote server and from the first execution itself, my code was hanging the program. Then I tried it as a console application to make sure it has nothing to do with the program itself but no luck!

string credentialsJson = @"{""username"":""test"",
                                          ""password"":""test"" 
                                       }";

            int tmp = ServicePointManager.DefaultConnectionLimit;
            HttpWebRequest request = (HttpWebRequest)WebRequest.Create(@"https://qrua.com/qr/service" + @"/auth/login");
            request.Method = "POST";
            request.KeepAlive = true;
            request.Timeout = 50000 ;
            request.CookieContainer = new CookieContainer();
            request.ContentType = "application/json";
            try
            {
                StreamWriter writer = new StreamWriter(request.GetRequestStream());
                writer.Write(credentialsJson);
                writer.Close();
            }
            catch (Exception e)
            {
                Console.WriteLine("EXCEPTION:" + e.Message);
            }

            //WebResponse response = request.GetResponse();
            try
            {
                using (WebResponse response = (HttpWebResponse)request.GetResponse())
                {
                    Console.WriteLine("request:\n" + request.ToString() + "\nresponse:\n" + response.ContentLength);
                    response.Close();
                }
            }
            catch (Exception e)
            {
                Console.WriteLine("EXCEPTION: in sending http request:" + " \nError message:" + e.Message);
            }





I was trying to use httpwebrequest to use a rest like service on a remote server and from the first execution itself, my code was hanging the program. Then I tried it as a console application to make sure it has nothing to do with the program itself but no luck!

string credentialsJson = @"{""username"":""test"",
""password"":""test""
}";

int tmp = ServicePointManager.DefaultConnectionLimit;
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(@"https://qrua.com/qr/service" + @"/auth/login");
request.Method = "POST";
request.KeepAlive = true;
request.Timeout = 50000 ;
request.CookieContainer = new CookieContainer();
request.ContentType = "application/json";
try
{
StreamWriter writer = new StreamWriter(request.GetRequestStream());
writer.Write(credentialsJson);
}
catch (Exception e)
{
Console.WriteLine("EXCEPTION:" + e.Message);
}

//WebResponse response = request.GetResponse();
try
{
using (WebResponse response = (HttpWebResponse)request.GetResponse())
{
Console.WriteLine("request:\n" + request.ToString() + "\nresponse:\n" + response.ContentLength);
response.Close();
}
}
catch (Exception e)
{
Console.WriteLine("EXCEPTION: in sending http request:" + " \nError message:" + e.Message);
}

Tried several things from different forums including this one but it doesnt help. Even a simple console app with the above code hangs the console indefinitely! Any help would be great..
AnswerRe: httpwebrequest getResponse( ) freezes my program Pin
Ennis Ray Lynch, Jr.9-Jul-10 8:31
Ennis Ray Lynch, Jr.9-Jul-10 8:31 
GeneralRe: httpwebrequest getResponse( ) freezes my program Pin
Luc Pattyn9-Jul-10 9:54
sitebuilderLuc Pattyn9-Jul-10 9:54 
GeneralRe: httpwebrequest getResponse( ) freezes my program Pin
Ennis Ray Lynch, Jr.9-Jul-10 10:06
Ennis Ray Lynch, Jr.9-Jul-10 10:06 
GeneralRe: httpwebrequest getResponse( ) freezes my program Pin
Luc Pattyn9-Jul-10 10:09
sitebuilderLuc Pattyn9-Jul-10 10:09 
QuestionHowTo: Accessing a cell in a multidimensional ArrayList Pin
Shaareable9-Jul-10 5:10
Shaareable9-Jul-10 5:10 
AnswerRe: HowTo: Accessing a cell in a multidimensional ArrayList Pin
PIEBALDconsult9-Jul-10 5:18
mvePIEBALDconsult9-Jul-10 5:18 
GeneralRe: HowTo: Accessing a cell in a multidimensional ArrayList Pin
Shaareable9-Jul-10 5:34
Shaareable9-Jul-10 5:34 
GeneralRe: HowTo: Accessing a cell in a multidimensional ArrayList Pin
PIEBALDconsult9-Jul-10 5:36
mvePIEBALDconsult9-Jul-10 5:36 
AnswerRe: HowTo: Accessing a cell in a multidimensional ArrayList Pin
PIEBALDconsult9-Jul-10 5:52
mvePIEBALDconsult9-Jul-10 5:52 
GeneralRe: HowTo: Accessing a cell in a multidimensional ArrayList Pin
Shaareable9-Jul-10 5:55
Shaareable9-Jul-10 5:55 
GeneralRe: HowTo: Accessing a cell in a multidimensional ArrayList Pin
Paladin20009-Jul-10 8:07
Paladin20009-Jul-10 8:07 
GeneralRe: HowTo: Accessing a cell in a multidimensional ArrayList Pin
Shaareable9-Jul-10 9:21
Shaareable9-Jul-10 9:21 
AnswerRe: HowTo: Accessing a cell in a multidimensional ArrayList Pin
Luc Pattyn9-Jul-10 10:01
sitebuilderLuc Pattyn9-Jul-10 10:01 
GeneralRe: HowTo: Accessing a cell in a multidimensional ArrayList Pin
Shaareable9-Jul-10 11:04
Shaareable9-Jul-10 11:04 
GeneralRe: HowTo: Accessing a cell in a multidimensional ArrayList Pin
Luc Pattyn9-Jul-10 11:25
sitebuilderLuc Pattyn9-Jul-10 11:25 
GeneralRe: HowTo: Accessing a cell in a multidimensional ArrayList Pin
PIEBALDconsult9-Jul-10 15:58
mvePIEBALDconsult9-Jul-10 15:58 
QuestionGet Results View from ICollectionView? Pin
xkrja9-Jul-10 4:24
xkrja9-Jul-10 4:24 

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.