|
Hello
What is the best for creating a log?
Is it the tracelistener or ....
best regards
dghdfghdfghdfghdgh
|
|
|
|
|
ellllllllie wrote: Hello
What is the best for creating a log?
Is it the tracelistener or ....
Are you in a hurry?
|
|
|
|
|
ellllllllie wrote: What is the best for creating a log?
An axe and a tree usually.
ellllllllie wrote: Is it the tracelistener or ....
My personal preference is log4net - It's an open source logging component.
Additional:
Oohh! A 1-vote - Someone obviously can't read smilies or simply has zero sense of humour.
modified on Wednesday, September 17, 2008 8:16 AM
|
|
|
|
|
Colin Angus Mackay wrote: or simply has zero sense of humour.
or just wants codeZ
Harvey Saayman - South Africa
Junior Developer
.Net, C#, SQL
you.suck = (you.Passion != Programming & you.Occupation == jobTitles.Programmer)
1000100 1101111 1100101 1110011 100000 1110100 1101000 1101001 1110011 100000 1101101 1100101 1100001 1101110 100000 1101001 1101101 100000 1100001 100000 1100111 1100101 1100101 1101011 111111
|
|
|
|
|
hi,
to create a log book (monitor login/logout & user actions) you need to store data, so you need to build a database.
one like this structure:
myUsers
id,F_name,L_name,...whatever
myLogTable1
id,id_user,date_login,date_logout
2,34,2-3-2007 20:30:23,2-3-2007 21:40:43
...
(login procedure edit; id,id_user,date_login
logout procedure edit; date_logout)
myLogTable2
id,date,user,action
34,3-8-2005 10-2-2004 10:23:34,add sale
45,3-8-2005 11-2-2004 10:33:14,delete client
...
or you can find a way to put 2 tables together.
(go to sql forum next time you need help on this subject)
nelsonpaixao@yahoo.com.br
trying to help & get help
|
|
|
|
|
Hi All, I want to create a windows service which will monitor some applications in some intervals of time. Suppose an application has to be running all the times get suddently stucks due to heavy load on it or some other reason, so this time our windows service looks that application which got stuck. Our service will kill the process of that application and restarts the application.
Is there anything like that?
Any help will be highly appreciable...
THANKS
Be a good professional who shares programming secrets with others.
|
|
|
|
|
Mohammed Hameed wrote: Be a good professional who shares programming secrets with others.
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
But where is the answer???
Be a good professional who shares programming secrets with others.
|
|
|
|
|
The answer is "yes, that's possible". But we're not going to write your code for you. You've already done the hard part by defining the problem.
Be a good professional who shows some initiative to work things out on his own.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Thanx...
Be a good professional who shares programming secrets with others.
|
|
|
|
|
But what if your service gets stuck?
|
|
|
|
|
No worries I will take care of that...first of all no chances of getting stuck the service itself.
Be a good professional who shares programming secrets with others.
|
|
|
|
|
Mohammed Hameed wrote: no chances of getting stuck the service itself
Mine used to get stuck all too often, but adding more try/catches seems to have fixed it.
|
|
|
|
|
hi all
i'm working on a project that should export every single page from an indesign cs2 file as a pdf.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using InDesign;
namespace trisa_indesign
{
public partial class frm_TrisaElectro : Form
{
public frm_TrisaElectro()
{
InitializeComponent();
}
public static object COMCreateObject(string sProgID)
{
Type oType = Type.GetTypeFromProgID(sProgID);
if (oType != null)
{
return Activator.CreateInstance(oType);
}
return null;
}
private void cmd_save_Click(object sender, EventArgs e)
{
func_objcreate();
}
public void func_objcreate()
{
InDesign.Application objApp = (InDesign.Application)COMCreateObject("Indesign.Application");
InDesign.Document objDoc = objApp.ActiveDocument;
func_HighExport(objApp, objDoc);
}
public void func_HighExport(InDesign.Application tmpApp, InDesign.Document tmpDoc)
{
string sfileName = Convert.ToString(tmpDoc.Name);
for (int i = 1; i <= tmpDoc.Pages.Count; i++)
{
string sSavePath = @"C:\trisaprojekt\" + sfileName + Convert.ToString(i) + ".pdf";
InDesign.Page objPage = (InDesign.Page)tmpDoc.Pages[i];
tmpDoc.Export(idExportFormat.idPDFType, sSavePath, false, tmpApp.PDFExportPresets["[PDF/X-3:2002]"]);
}
}
}
}
plz ignore the comments in german and the code between /* */ is a javascript sample.
now the command: InDesign.Page objPage = (InDesign.Page)tmpDoc.Pages[i];
should select everypage beginning with 1 to the max number of pages and then export them. but of course i doenst work.
can anyone give me a hint or something what i'm doing wrong?
kind regards
|
|
|
|
|
Hello everyone,
I am searching into MSDN for quite some time, but failed to find some dedicated event ID number for system reboot, system shutdown and system start events.
Where to find such event ID?
thanks in advance,
George
|
|
|
|
|
DataTable dt = new DataTable();
StreamReader sr = new StreamReader("C:\\FileName.csv");
DataColumn[] cols = new DataColumn[sr.ReadLine().Split(',').Length];
dt.Columns.AddRange(cols);
while(!sr.EndOfStream)
dt.Rows.Add(sr.ReadLine().Split(','));
datagrid1.DataSource = dt;
What's so wrong with that?? Any better practice??
Thanks!
All generalizations are wrong, including this one!
(\ /)
(O.o)
(><)
|
|
|
|
|
Well, from the error I suspect you have more fields in your csv file than columns in the data table.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
I know, and it's not working even when I manually increase the number of my columns, in fact, the main reason why I'm asking this question is to find a better way to do it
Thanks anyways Ashfield!
All generalizations are wrong, including this one!
(\ /)
(O.o)
(><)
|
|
|
|
|
To do what you want you need tio ensure that either all records have the same number of fields (maybe reject those that differ from the first one) or go through your file first and find the maximum number of fields.
Personally I would reject those that have a different number from the first record as you have no idea where in the string additional values have been added (or removed) so the values in the columns become meaningless.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
Muammar© wrote: What's so wrong with that??
You have more data than columns.
Muammar© wrote: Any better practice??
Yes, of course.
You are not performing any validation on the data in the reader whatsoever. This is bad, very bad, in fact you can't believe how mind bogglingly massively bad that is....
Always validate your input, whether from a user interface control, a file on a disk or the database. If there is the possibility that the information could be wrong or tampered with you should validate it.
If you are sure the line should be correct you should code in a way that aids debugging. You should extract the line from the file into its own variable, and use the debugger to check what it is.
You should split the string up into another varialbe and use the debugger to tell you what is in that.
You should never just dump the result of a chained set of method calls as the parameter to another method call unless you can GUARANTEE that it won't break or have unexpected results. You cannot make that guarantee, so don't do it!
while (!sr.EndOfStream)
{
string line = sr.ReadLine();
string[] tokens = line.Split(',');
dt.Rows.Add(tokens);
}
In the above sample, use the debugger to check what is in line and tokens . Is it what you expect? Is it doing something you didn't expect? What is it doing that is wrong? How would you correct that?
|
|
|
|
|
Colin Angus Mackay wrote: This is bad, very bad, in fact you can't believe how mind bogglingly massively bad that is....
I'm sorry but definitely I'm not using such code, I just took out a quick an modified snippet to make my post short, when I said "better practice" I meant the data storage/manipulation process, I mean, are dataRows/dataColumns and dataTables are the best?? Any tips to make the process faster than doing it this way?
Thanks anyways Colin, you got my five for taking the time to help
All generalizations are wrong, including this one!
(\ /)
(O.o)
(><)
|
|
|
|
|
Just read your posts on Extension Methods and Mixins -- very good.
I'm still not enthusiastic about Extension Methods for a number of reasons, one of which is that I wanted finer-grained control over including them.
What I did with one last week was to put the extension method in a namespace that contains only that method (or family of methods) and is named for that method, so I can do something like:
using PIEBALD.Lib.LibExt.IsNullOrEmpty ;
to only include those extension methods that I intend to use.
|
|
|
|
|
Wrong number!
All generalizations are wrong, including this one!
(\ /)
(O.o)
(><)
|
|
|
|
|
"You're not thinking four-dimensionally." -- Emmett Brown
|
|
|
|
|
Hi,im bit new to .net and Now im stucked in this matter for few days!!
If Some one can help me,it will be great!!
What i want to do is,Im loading data to the left side listBox as follows
//Loading the AssistanceType
DataTable dtAssistanceType = ((MasterUI)this.ParentForm).ObjRemoteObject.VoTBL.GetAssistanceType();
ArrayList arAssis = new ArrayList();
arAssis.Add(dtAssistanceType);
lstTypeofAssistanceLeft.DataSource = dtAssistanceType;
lstTypeofAssistanceLeft.DisplayMember = "AssistanceType";
lstTypeofAssistanceLeft.ValueMember = "AssistanceTypeID";
Assistance[] ass = new Assistance[] { };
lstTypeofAssistanceRight.DataSource = ass;
lstTypeofAssistanceRight.DisplayMember = "AssistanceType";
lstTypeofAssistanceRight.ValueMember = "AssistanceTypeID";
And then ,when i press a button,i want to add the selected item to the right listBox and get the ValueMember (ID) of the selected value!!
I did it like this,
DataRowView dr = (DataRowView)lstTypeofAssistanceLeft.SelectedItem;
Assistance objAss = new Assistance();
//objAss.AssistanceTypeID =Convert.ToInt16(dr["AssistanceTypeID"].ToString());
//objAss.AssistanceType = dr["AssistanceType"].ToString();
lstTypeofAssistanceRight.Items.Add(lstTypeofAssistanceLeft.SelectedItem);
objAss.AssistanceTypeID = Convert.ToInt16(dr["AssistanceTypeID"].ToString());
objAss.AssistanceType = dr["AssistanceType"].ToString();
int id = Convert.ToInt16(lstTypeofAssistanceRight.SelectedValue);
But when i did like this,it doesn't give any ID!!!
But if i bind a data source to LeftlistBox,it wont allow me to add items!
If i didnt bind the dataSource it wont give the ID.
Anyone knows the solution for this???
Thanks alot!!!
|
|
|
|