Click here to Skip to main content
15,887,135 members
Home / Discussions / C#
   

C#

 
AnswerRe: C# take xml and store in sql server Pin
V.29-Aug-12 2:04
professionalV.29-Aug-12 2:04 
GeneralRe: C# take xml and store in sql server Pin
sc steinhayse29-Aug-12 3:51
sc steinhayse29-Aug-12 3:51 
AnswerRe: C# take xml and store in sql server Pin
jschell30-Aug-12 8:59
jschell30-Aug-12 8:59 
QuestionC# use linq to parse xml Pin
dcof28-Aug-12 17:28
dcof28-Aug-12 17:28 
AnswerRe: C# use linq to parse xml Pin
PIEBALDconsult28-Aug-12 19:21
mvePIEBALDconsult28-Aug-12 19:21 
AnswerRe: C# use linq to parse xml Pin
V.29-Aug-12 2:00
professionalV.29-Aug-12 2:00 
GeneralRe: C# use linq to parse xml Pin
dcof29-Aug-12 10:56
dcof29-Aug-12 10:56 
Questionif webbrowser hangs, then retry, how to check if hanging c# Pin
Member 938944428-Aug-12 13:52
Member 938944428-Aug-12 13:52 
Hello All,

I am using a winapp form c# (.net4.0)to login and navigate deep into a webpage, upload a file, download a file. All this works successfully... MOST of the time. Everyonce in a while, when I hit the download button, the system seems to hang. Like a webpage that never fully loads. My goal here is if ALL the pages don't load successfully, then close all webbrowsers and re-try process. Anyone have any ideas to see if page is hung on loading. My first thought was to have some sort of timer to check, if doesn't load, then start over.

I am opening a webbrowser object inside my winform in c#.
Here's my idea and please feel free to rip apart with a better concept.

Concept is timer launches Invoke(naviFunction). If it gets to the end of naviFunction then just break loop and continue. However, if the webbrowsing hangs somewhere, then the 2 minute timer will get hit, and restart the whole process.

Then maybe put some counter and if it tries twice, completely stop program so I can investigate.

just to put a bit more background... in the navigating section I am launching 2 new short threads. they both finish before the end of the main navigation. I've put them in to handle pop up windows where the main code pauses when they are on screen.

So I've implemented and I'm a bit stuck on something.
When I put a normal process everything works successfully.
When I test a fake navigation hanging point... such as below.. The code does restart at 2 minutes and it completes the re-cycle successfully. The problem is when it is done. Instead of moving on in the code, (outside the timer area) it goes right back to the point where it originally got hung on. But since I already did it successfully I need it to exit out of the whole timer area. ANy idea what I'm doing wrong?

so I think I found where the problem lies but I don't know how to fix it.
the timer I am using... I used Invoke(new naviTimer(naviTimerFunction) to launch the section of navigation/download. So when the fake hang hits... then 2 minutes passes, it resets (like its supposed to). Then completes properly... soon as the navigation/download completes, I need it to go to the main code, but instead it hits the Invoke(naviTimer) again in the timer... and it goes back to where fake hanging originally paused and tries to continure from there. ideas??

maincode
{
x=0
dountil x<>0
start timer (timer launched instantly)
if naviTimerFunction completed, then break loop
stop timer
loop

...continue code
...continue code
...continue code
...continue code

}

timer()
{
reset timer interval to 2 minutes
Invoke(new naviTimer(naviTimerFunction))

}

naviTimerFunction
{
navigate
navigate (fake hanging point!!!)
navigate (start sub thread)
download (end sub thread)
navigate (start sub thread)
navigate (end sub thread)
stoptimer
}

tried a different way, used systems.timer.timer and before it even runs the first time it gives me error stating not a single thread. Cannot create webbrowser objects. Cant get that to work either..... ugh
AnswerRe: if webbrowser hangs, then retry, how to check if hanging c# Pin
Shameel28-Aug-12 14:54
professionalShameel28-Aug-12 14:54 
GeneralRe: if webbrowser hangs, then retry, how to check if hanging c# Pin
Member 938944428-Aug-12 16:26
Member 938944428-Aug-12 16:26 
AnswerRe: if webbrowser hangs, then retry, how to check if hanging c# Pin
Shameel28-Aug-12 19:30
professionalShameel28-Aug-12 19:30 
AnswerRe: if webbrowser hangs, then retry, how to check if hanging c# Pin
Eddy Vluggen28-Aug-12 23:09
professionalEddy Vluggen28-Aug-12 23:09 
GeneralRe: if webbrowser hangs, then retry, how to check if hanging c# Pin
Member 88893234-Sep-12 3:52
Member 88893234-Sep-12 3:52 
QuestionSecurity of Passwords Pin
zephaneas28-Aug-12 13:18
zephaneas28-Aug-12 13:18 
AnswerRe: Security of Passwords Pin
jschell28-Aug-12 14:00
jschell28-Aug-12 14:00 
AnswerRe: Security of Passwords Pin
Peter_in_278028-Aug-12 15:13
professionalPeter_in_278028-Aug-12 15:13 
GeneralRe: Security of Passwords Pin
Paul Conrad28-Aug-12 18:24
professionalPaul Conrad28-Aug-12 18:24 
AnswerRe: Security of Passwords Pin
Paul Conrad28-Aug-12 18:25
professionalPaul Conrad28-Aug-12 18:25 
AnswerRe: Security of Passwords Pin
Bernhard Hiller28-Aug-12 21:42
Bernhard Hiller28-Aug-12 21:42 
AnswerRe: Security of Passwords Pin
BobJanova28-Aug-12 23:36
BobJanova28-Aug-12 23:36 
AnswerRe: Security of Passwords Pin
Dave Kreskowiak29-Aug-12 2:06
mveDave Kreskowiak29-Aug-12 2:06 
GeneralRe: Security of Passwords Pin
Eddy Vluggen29-Aug-12 2:24
professionalEddy Vluggen29-Aug-12 2:24 
AnswerRe: Security of Passwords Pin
Pete O'Hanlon29-Aug-12 3:09
mvePete O'Hanlon29-Aug-12 3:09 
QuestionC# create folder and place documents Pin
dcof28-Aug-12 12:05
dcof28-Aug-12 12:05 
AnswerRe: C# create folder and place documents Pin
Richard Andrew x6428-Aug-12 12:57
professionalRichard Andrew x6428-Aug-12 12:57 

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.