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

C#

 
AnswerRe: C# Keybind for Autoclicker Pin
OmegaExtern16-Aug-14 20:44
OmegaExtern16-Aug-14 20:44 
GeneralRe: C# Keybind for Autoclicker Pin
Aaudiio16-Aug-14 20:47
Aaudiio16-Aug-14 20:47 
GeneralRe: C# Keybind for Autoclicker Pin
OmegaExtern16-Aug-14 20:50
OmegaExtern16-Aug-14 20:50 
Questioncheck array value exists Pin
scottichrosaviakosmos16-Aug-14 3:11
scottichrosaviakosmos16-Aug-14 3:11 
AnswerRe: check array value exists Pin
onelopez16-Aug-14 3:34
onelopez16-Aug-14 3:34 
GeneralRe: check array value exists Pin
scottichrosaviakosmos16-Aug-14 4:03
scottichrosaviakosmos16-Aug-14 4:03 
AnswerRe: check array value exists Pin
OriginalGriff16-Aug-14 3:39
mveOriginalGriff16-Aug-14 3:39 
QuestionCatching exceptions on backgroundworker Pin
pjank4215-Aug-14 19:44
pjank4215-Aug-14 19:44 
I have implemented a backgroundworker which simulates a turn in a game I have created:
C#
try
                {

                    GameObjectHelpers.SimulateTurn();

                }
                catch (Exception ex)
                {
                    System.IO.StreamWriter file = new System.IO.StreamWriter(AppSettings.getCommonApplicationDataPath() + "\\log.log");
                    file.WriteLine("{0}: {1} {2}", DateTime.Now.ToShortDateString(), DateTime.Now.ToShortTimeString(), ex.StackTrace);
                    file.WriteLine(ex.Message);
                    file.Close();
                   

                }


My problem is that the message from the exception is not very useable:
8/15/2014: 5:25 PM at Model.GeneralModel.Helpers.GameObjectHe lpers.DoDailyUpdate()
at Model.GeneralModel.Helpers.GameObjectHe lpers.SimulateTurn()
at Model.GeneralModel.Helpers.WorkersModel .GameObjectWorker.bw_DoWork(Object sender, DoWorkEventArgs e)

Is there a better way of catching and logging the exception?
QuestionRe: Catching exceptions on backgroundworker Pin
Richard MacCutchan15-Aug-14 21:25
mveRichard MacCutchan15-Aug-14 21:25 
AnswerRe: Catching exceptions on backgroundworker Pin
pjank4216-Aug-14 1:50
pjank4216-Aug-14 1:50 
GeneralRe: Catching exceptions on backgroundworker Pin
Richard MacCutchan16-Aug-14 5:10
mveRichard MacCutchan16-Aug-14 5:10 
AnswerRe: Catching exceptions on backgroundworker Pin
Eddy Vluggen16-Aug-14 2:10
professionalEddy Vluggen16-Aug-14 2:10 
AnswerRe: Catching exceptions on backgroundworker Pin
jschell17-Aug-14 9:56
jschell17-Aug-14 9:56 
GeneralRe: Catching exceptions on backgroundworker Pin
pjank4218-Aug-14 8:40
pjank4218-Aug-14 8:40 
QuestionMissing TCP Packets Pin
M Riaz Bashir15-Aug-14 19:24
M Riaz Bashir15-Aug-14 19:24 
AnswerRe: Missing TCP Packets Pin
Dave Kreskowiak16-Aug-14 4:29
mveDave Kreskowiak16-Aug-14 4:29 
GeneralRe: Missing TCP Packets Pin
M Riaz Bashir16-Aug-14 19:54
M Riaz Bashir16-Aug-14 19:54 
AnswerRe: Missing TCP Packets Pin
Rob Philpott16-Aug-14 6:34
Rob Philpott16-Aug-14 6:34 
GeneralRe: Missing TCP Packets Pin
M Riaz Bashir16-Aug-14 19:54
M Riaz Bashir16-Aug-14 19:54 
QuestionThread Freeze when trying Abort Pin
Member 1098515215-Aug-14 12:17
Member 1098515215-Aug-14 12:17 
GeneralRe: Thread Freeze when trying Abort Pin
PIEBALDconsult15-Aug-14 12:47
mvePIEBALDconsult15-Aug-14 12:47 
QuestionSummary Report in GridView Pin
sk_ko14-Aug-14 22:02
sk_ko14-Aug-14 22:02 
AnswerRe: Summary Report in GridView Pin
Chris Quinn14-Aug-14 22:36
Chris Quinn14-Aug-14 22:36 
AnswerRe: Summary Report in GridView Pin
Mycroft Holmes14-Aug-14 23:00
professionalMycroft Holmes14-Aug-14 23:00 
GeneralScope of Share point and Silverlight Pin
Member 1059394814-Aug-14 3:40
Member 1059394814-Aug-14 3:40 

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.