Click here to Skip to main content
15,894,328 members
Home / Discussions / C#
   

C#

 
QuestionCookies storing Problem in C# Pin
gopinathtamil23-Apr-09 19:49
gopinathtamil23-Apr-09 19:49 
QuestionPublish : Setup is not working on client machine Pin
ddravin200023-Apr-09 19:33
ddravin200023-Apr-09 19:33 
AnswerRe: Publish : Setup is not working on client machine Pin
Abhijit Jana23-Apr-09 20:04
professionalAbhijit Jana23-Apr-09 20:04 
GeneralRe: Publish : Setup is not working on client machine Pin
ddravin200023-Apr-09 20:54
ddravin200023-Apr-09 20:54 
Questionretrive image local path from web handler Pin
LiYS23-Apr-09 17:20
LiYS23-Apr-09 17:20 
AnswerRe: retrive image local path from web handler Pin
Christian Graus23-Apr-09 20:22
protectorChristian Graus23-Apr-09 20:22 
QuestionHow To Capture The Whole ClientZone Of Window With The Scroll Pin
wangxuekong23-Apr-09 16:19
wangxuekong23-Apr-09 16:19 
QuestionHttpWebRequest and HttpWebResponse Pin
AndieDu23-Apr-09 15:25
AndieDu23-Apr-09 15:25 
Dear All,

I had the following code tested in my test environment, it works fine in my test environment

private bool CheckRcvFileLocation(string rcvLocation, ForeignSystem foreignSystem)
{

Uri uri1 = new Uri(rcvLocation);

HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(uri1);

request.Credentials = foreignSystem.NetworkCredential;

request.Method = "HEAD";

HttpWebResponse response = null;

try
{

System.Console.WriteLine("test2");

if (request == null)

{

System.Console.WriteLine("Test2a");

}

else

{

System.Console.WriteLine("Test2b");

}

response = (HttpWebResponse)request.GetResponse();

System.Console.WriteLine("Test3");

return (response.StatusCode != HttpStatusCode.NotFound);

}

catch (WebException e)

{

response = (HttpWebResponse)e.Response;

if (response.StatusCode == HttpStatusCode.NotFound)

return false;

else

throw;

}

finally

{

if (response != null)

response.Close();

}

}

however when I put it into the real world, the "Test3" never gets executed, instead it returns me "Object reference not set to an instance of an object" as soon as the code goes to "response = (HttpWebResponse)request.GetResponse();"

Are there any settings that i need to aware to get these codes working in production environment?


regards


Andie
QuestionAny news when LINQ be able to talk to Oracle/MySQL Pin
devvvy23-Apr-09 15:05
devvvy23-Apr-09 15:05 
QuestionOperator | | Pin
ctreed72823-Apr-09 13:38
ctreed72823-Apr-09 13:38 
AnswerRe: Operator | | Pin
Luc Pattyn23-Apr-09 14:59
sitebuilderLuc Pattyn23-Apr-09 14:59 
GeneralRe: Operator | | Pin
ctreed72823-Apr-09 15:17
ctreed72823-Apr-09 15:17 
GeneralRe: Operator | | Pin
Luc Pattyn23-Apr-09 15:21
sitebuilderLuc Pattyn23-Apr-09 15:21 
GeneralRe: Operator | | Pin
ctreed72823-Apr-09 16:14
ctreed72823-Apr-09 16:14 
QuestionRe: Operator | | Pin
CPallini23-Apr-09 21:45
mveCPallini23-Apr-09 21:45 
AnswerRe: Operator | | Pin
PIEBALDconsult24-Apr-09 4:01
mvePIEBALDconsult24-Apr-09 4:01 
Questionsending SMS from PC through USB port Pin
invisible_eagle23-Apr-09 12:43
invisible_eagle23-Apr-09 12:43 
AnswerRe: sending SMS from PC through USB port Pin
akyriako7824-Apr-09 1:45
akyriako7824-Apr-09 1:45 
QuestionReading from excel.. Pin
Jacob Dixon23-Apr-09 10:44
Jacob Dixon23-Apr-09 10:44 
AnswerRe: Reading from excel.. [modified] Pin
fly90423-Apr-09 11:27
fly90423-Apr-09 11:27 
GeneralRe: Reading from excel.. Pin
Jacob Dixon24-Apr-09 13:38
Jacob Dixon24-Apr-09 13:38 
GeneralRe: Reading from excel.. Pin
fly90424-Apr-09 14:08
fly90424-Apr-09 14:08 
GeneralRe: Reading from excel.. Pin
fly90424-Apr-09 14:48
fly90424-Apr-09 14:48 
GeneralRe: Reading from excel.. Pin
Jacob Dixon24-Apr-09 14:50
Jacob Dixon24-Apr-09 14:50 
AnswerRe: Reading from excel.. Pin
Ashfield23-Apr-09 20:56
Ashfield23-Apr-09 20:56 

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.