|
Hi Mirko,
I have tested this class, it is very slow for big files. In fact, SharpZipLib is faster. But thanks though for this info. I have learned something new
Cheers
|
|
|
|
|
|
Yes!! That is exactly what I am looking for. I have to modify the code a little bit to support compression. Thanks Programm3r for your help
|
|
|
|
|
Hello once again. Just found this: DotNetZip[^] looks quite powrfull. Any ideas about speed/compression?
|
|
|
|
|
Works great, very speedy, good compression, good features. Recommended!
|
|
|
|
|
Hello all
i ma trying to learn how to program a windows service application
i had add an event log and a timer that used to write to file
here is the code
protected override void OnStart(string[] args)
{
eventLog1.WriteEntry("In OnStart");
timer1.Start();
}
protected override void OnStop()
{
eventLog1.WriteEntry("In onStop");
timer1.Stop();
}
protected override void OnContinue()
{
eventLog1.WriteEntry("In OnContinue");
timer1.Start();
}
FileStream fs;
StreamWriter sw;
private void timer1_Tick(object sender, EventArgs e)
{
fs = new FileStream(@"C:\tem.txt", FileMode.OpenOrCreate, FileAccess.Write);
sw = new StreamWriter(fs);
sw.BaseStream.Seek(0, SeekOrigin.End);
sw.WriteLine(DateTime.Now.ToString());
sw.Flush();
sw.Close();
}
and i had added an installer to install the windows service, i followed the instructions that is in the MSDN
http://msdn.microsoft.com/en-us/library/zt39148a%28VS.80%29.aspx
first it works and installed but when i tried to run it from the windows management console
it run and ends immediatly and i got a message telling me that some services closed coze it is not doing anything
when i tried to make a new installation package, and reninstall the service, the installation package failed to install the service and give me 2 messages
the first one saying that source of the service is on the local machine
and finally i got a meesage that the installation is interupted and ended not successfuly
plz help to resolve that.....
|
|
|
|
|
Hi,
I think this might help you: Simple Windows Service Example[^]
Regards,
The only programmers that are better that C programmers are those who code in 1's and 0's
Programm3r
My Blog: ^_^
|
|
|
|
|
it is most like the same procedures i had did
|
|
|
|
|
|
I use the [System.Timers.Timer] object in my Windows Services: -
System.Timers.Timer t;
void OnStart(string[] args)
{
t = new System.Timers.Timer();
t.Interval = 1000;
t.Elapsed += new System.Timers.ElapsedEventHandler(t_Elapsed);
t.Enabled = true;
}
void t_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
{
...
}
|
|
|
|
|
Good day
How do i find every occurence of a substring that begin with a specefied set of characters and end with another set of characters eg
string str = "src=test.pgn testing sub src=file.pgn find it"
i want to read strings that start with src and end with .pgn in the above example i want the following strings in an array "src=test.pgn" and src=file.pgn
Thank you
|
|
|
|
|
|
why are regular expressions so difficult to understand???????
|
|
|
|
|
Don't worry, most people hate them too. I rarely use them, and always have to go back to the manual to check things when I need to.
Post what your trying (in a new question) and maybe some reg-ex superhero can help.
http://xkcd.com/208/[^]
Simon
|
|
|
|
|
|
Hi,
I have problem in keeping the selected text highlighted in a richtextbox when the mouse clicked to other control, eg changing font from a list box or clicking on a treeview control. The text is still selected but the the text not highlighted. How can I maintain the text selection highlighted?
Can someone help?
Regards,
WingOnn
|
|
|
|
|
Set the "HideSelection" property on the text box to false.
Simon
|
|
|
|
|
Simon,
Thanks. I overlooked this property.
Regard,
Wing Onn
|
|
|
|
|
|
I have two user tables in an existing SQL database. One contains only u_id(int) not null and the other contains userid(int) not null, username and so on. I am trying to insert new users in this table but I am getting Sql exception error. I am looking for a function which increments the uid and userid in both tables. I dont know how to go about it.
Regards,
Pradeep
|
|
|
|
|
You could redefine the columns to be automatically incrementing numbers. You use the "IDENTITY(x,y)" command when defining the table. (x = start, y = increment value).
e.g.
CREATE TABLE TableName
(UserId INT IDENTITY(1,1) NOT NULL,
UserName VARCHAR(50) NOT NULL,
Password VARCHAR(50) NOT NULL)
(Or using the GUI, you can set the Identity Specification property of the column to yes, and set the seed and increment there).
Personally though, using an autonumber as the primary key for a user isn't a very good design. Instead, I would define the primary key of a user as a "uniqueidenitifer" type (in SQL) and use guids in C#. Then, when you need to create a new user, you can call Guid.NewGuid() to create a new guid value that you use for that user.
Good luck.
Simon
|
|
|
|
|
Thanks Simon, what if i am not allowed to change the design , since the system is already in place. I have to make a new system from scratch which will use the existing user table to give the roles and access. Is there a way to append the new user id by 1 in both tables..
|
|
|
|
|
Complain to management that the DBA is not doing or capable of doing his job properly.
xacc.ide - now with TabsToSpaces support IronScheme - 1.0 alpha 4a out now (29 May 2008) ((lambda (x) `((lambda (x) ,x) ',x)) '`((lambda (x) ,x) ',x))
|
|
|
|
|
Haha. Yeah, actually ignore my answer, just do this.
Simon
|
|
|
|
|
Ahh. Well in that case there is no easy way.
Are you sure you can't change the column properties. You should be able to modify it even if the database is already live.
If not, first you'll have to do a select statement to find out what the existing maximum value is (There is a command[^] specifically to do this)
Then you'll have to increment it, and include it when you insert the new user.
If multiple people/programs can be accessing your database at the same time, be careful to check you program correctly handles the situation where 2 people both try and insert a user at the same time. You'll get a duplicate insert exception on the second one, so you will need to handle that and try again. Or take a lock of some kind.
Simon
|
|
|
|