|
I'm using Microsofts implementation of ripemd 160, as declared in System.Security.Cryptography. It produces different results when run on Windows XP and server 2003.
I needed to test an application via RDP on a 2003 machine and noticed that the hashes produced was not coherent with the ones I got when using windows XP.
Is this a known bug or am I doing something wrong? Please let me know if you need additional information.
/martin
|
|
|
|
|
Bumping the thread and correcting myself.
After some serious tracing I have concluded that the problem is regarding the byte order in win2003. The problem appears when translating the byte array from the hash to a integer. The hashbytes correspond to eachother.
I cant seem to find a workaround for this problem. Does anybody have one?
|
|
|
|
|
Any one help me that , I have 2 files i.e File1 & File2.
My objective is to append all the contents of File2 into the preexisting File1.
With Regards
Tapan
|
|
|
|
|
File.AppendAllText("File1",File.ReadAllText("File2"));
If your files are at different locations, you will need to specify full path
|
|
|
|
|
I've been trying to keep information of individuals logged on to my website so now i dont know how to do that cause on each and every page load i loose the values which were stored on my variable so how do i overcome such problem.Cause i have masterpage with login section and subpages loading on master page will use those values to check user's rights to the system when ever i load a page.
mafunwat@yahoo.com
Department of IT
DUT
|
|
|
|
|
u can put the variables in session object.
rahul
|
|
|
|
|
I created Check Boxes in Property Grid using UITypeEditor. I also need to create Property items dynamically , so I used Custom Property creation using PropertyDescriptor class adn created properties using CreateProoperty.
The problem is: After using CustomProperty descriptor I am no longer able to see checkboxes or listBoxes created using UIType Editor .
Any one have faced this problem before ? How to use UITypeEditor and PropertyDescriptor together in my class and does not lose the UITypeEditor visual (checkboxes, Listboxes)
Cheers,
Rajan
Rajan
|
|
|
|
|
Typically the editor is defined as an attribute on the property. Since you are dynamically adding properties, then you would either need to manually create and add the attribute to the PropertyDescriptor, or simply override the GetEditor[^] method.
Take care,
Tom
-----------------------------------------------
Check out my blog at http://tjoe.wordpress.com
|
|
|
|
|
Hello.
I'm having a bit of problem with a service written in C#. It starts just fine under Windows XP and Vista. But when i try to run it under Windows 2000 (server) the service just hangs on startup.
The service is set to run as LocalSystem, and the only thing it does in the OnStart()-method is to spawn a worker-thread that is supposed to do all work. However the OnStart()-method doesnt even trigger. I've added a couple of trace-points using EventLog.WriteEntry() to see how far the service comes when its starting.
Seem to hang on the call to ServiceBase.Run(servicesToRun); Sometimes the EventLog states that the service hung on startup, but no further info is provided (and the service can still bee seen as "starting" in the service manager).
Does someone here know whats going on? And how to fix it?
|
|
|
|
|
Have you tried running it as a console app to see if it's the code or if it's because it's a service?
9 times out of 10 I find it is the fact that it's running as a service :/ but atleast then you'll know for sure.
Theres always the old fall back of putting
MessageBox.Show("1");
//line of code
MessageBox.Show("2");
//line of code
MessageBox.Show("3");
then setting the service to allow interaction with the desktop, this will allow you identify the exact line of failiure.
Another option is putting in Thread.Sleep(10000); somewhere near the start of the service ... this gives you a bit of time to attach to the process so you can properly debug it. Of course it also eats up part of your 30 second timeout before the service will be reported as failed.
|
|
|
|
|
Havent tried to run it as a normal application yet. Will do that later.
The good old trick of constant output is what I've been trying. Just before the call to ServiceBase.Run(servicesToRun); I'm callin EventLog.WriteEvent() and the first thing that is done in the OnStart()-handler is to write another entry in the event log.. That second entry never appears in the log however... But just to be sure, I will try your example with letting the application interact with the desktop.
Using remote debugging reveals tow threads, one without a traceable stack and one thread being stuck on the ServiceBase.Run(servicesToRun)-call.
|
|
|
|
|
Hello All,
Iam a new to this forum.I want some help.
Iam having an .aspx page in that iam having many listbox control.Selection mode is single.Iam binding data to these list box control from the data base while page loading.This is fine no problem.Now i want to store the selected values in to another table on a button click event.but iam getting selected itmes as null.
Please help on this.
i want to join this group
|
|
|
|
|
add the following framework base class
Microsoft.Visual basic.Compatibility.vb6
and use the functions
Support.GetItemData()
Support.SetItemData()
Do u know something the solution about the problem i mentioned just below ur query
Sonia Gupta
Soniagupta1@yahoo.co.in
Yahoo messengerId-soniagupta1
Love is Friendship and Friendship is Love....
|
|
|
|
|
i want to show the percentage of the records in pie charts and bar charts using the crystal reports.Can somebody please provide any useful link.
Sonia Gupta
Soniagupta1@yahoo.co.in
Yahoo messengerId-soniagupta1
Love is Friendship and Friendship is Love....
|
|
|
|
|
Hi,
As per my knowledge all the 7 blocks in the Microsoft Enterprise Library(Pattern & Practices) require atleast a configuration(.config) file.
But while developing a .dll i.e an assembly without using a .config file can I use Enterprise Library. if not for all then for logging or exception handling referencing the dlls from the enterprise Library.....
Required an expert opinion...
Thanks
Sangram
(A battle with self)
Life is simple, we are the ones makes the living difficult
|
|
|
|
|
Would someone please give me a good book I can learn C# 2005 from? I am not new to programming, but kind of new to C#.
Thanks.
|
|
|
|
|
|
Sams Teach Yourself Visual Studio .NET 2003 in 21 days[^]
Their may be a more up to date one, but this is the one that I use.
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my homepage Oracle Studios[ ^]
|
|
|
|
|
I have these line of codes :
try
{
string fromDir = file.Substring(0, file.LastIndexOf("\\"));
System.IO.Directory.SetCurrentDirectory(fromDir);
if (!File.Exists(fileToZip))
{
throw new FileNotFoundException("The specified file " + fileToZip + " could not be found. Zipping aborderd");
}
FileStream StreamToZip = new FileStream(fileToZip, FileMode.Open, FileAccess.ReadWrite);
FileStream ZipFile = File.Create(zippedFile);
ZipOutputStream ZipStream = new ZipOutputStream(ZipFile);
ZipEntry ZipEntry = new ZipEntry(fileToZip.Substring(fileToZip.LastIndexOf("\\") + 1));
ZipStream.PutNextEntry(ZipEntry);
ZipStream.SetLevel(CompressionLevel);
if (password != null && !password.Equals(string.Empty))
ZipStream.Password = password;
byte[] buffer = new byte[BlockSize];
System.Int32 size = StreamToZip.Read(buffer, 0, buffer.Length);
ZipStream.Write(buffer, 0, size);
try
{
while (size < StreamToZip.Length)
{
int sizeRead = StreamToZip.Read(buffer, 0, buffer.Length);
ZipStream.Write(buffer, 0, sizeRead);
size += sizeRead;
}
}
catch (System.Exception ex)
{
throw ex;
}
ZipStream.Finish();
ZipStream.Close();
StreamToZip.Close();
}
catch (Exception ex)
{
throw ex;
}
The error occurs on this line
FileStream ZipFile = File.Create(zippedFile);
how am i going to resolve it? thanks
|
|
|
|
|
The secret is in reading the excepion text :P
toink toink wrote: The process cannot access the file because it is being used by another process.
Which means someone already has a lock on that file. Possibly you.
There are a few tools around which allow you to investigate the locks on a file. Theres a few at SysInternals[^] but personally I like Unlocker[^].
|
|
|
|
|
hi there,
i have a problem that is when i write connection string of sql like this
dataConnection.ConnectionString = "Data Source= MATO\\SQLEXPRESS; Integrated Security=true; Initial Catalog=ABCdatabase;";
then its works
but when i wrote something like this
string connection = File.ReadAllText(@"C:\Documents and Settings\Quarantined\Desktop\connection.txt");
dataConnection.ConnectionString = connection;
its giving error "Instance Failed"
the connection.txt file contains the same line which is written above for connectionstring
any one know the solution ../?
Becoming Programmer...
|
|
|
|
|
I guess. maybe. there are some whitespace or newline in that textfile..
Why do you wanna store the connection string in textfile? I would suggest you to store the connectionstring in either App.Config or web.config.
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message". Why vote? Plz Read it here. Thank you.
|
|
|
|
|
I feel really stupid right about now.
I have had someone explain it to me but I don't understand. I have a checkedlistbox which i want to allow multple skills to be matched against a person. I have dataadapters and sql server database. I have an employees with employeeID table and a technicalskills table with techskilsID . I was told to create another table with tchskillsid and empid so I can save multiple selections in there. My code is all over the place. I'm sure no one will want to help me with this one which is understandable, but I don't know where to turn to. Apparently I have to get the ID's from the selected text by using select statement and then insert into the new employeeskillset table and match against empid in the employees table and store the record in there against the persons name. confused yet? I am.
The following returns error:
Error 5 No overload for 'empSaveButton2_Click' matches delegate 'System.EventHandler'
My CODE
private void empSaveButton2_Click(object sender, DataSet dataset, string connectionString, string queryString, EventArgs e)
{
myConnection = new SqlConnection("server = ADMMSAS7;database=Dev_RST;Trusted_Connection=yes");
myConnection.Open();
// foreach (int indexChecked in techSkillsCheckListBox2.CheckedIndices)
// {
for (int x = 0; x <= techSkillsCheckListBox2.CheckedItems.Count - 1; x++)
// {
// If so, loop through all checked items and print results.
{
DataSet ds = new DataSet();
string sql = "Select t.TechnicalSkillsID from TechnicalSkills t where t.TechnicalSkillsID = '" + techSkillsCheckListBox2.CheckedItems[x] + "')";
SqlDataAdapter adapter = new SqlDataAdapter();
adapter.SelectCommand = new SqlCommand(sql, myConnection);
adapter.Fill(ds, "TechSkillSet");
DataTable dt = ds.Tables["TechSkillSet"];
foreach (DataRow row in dt.Rows)
{
foreach (DataColumn col in dt.Columns)
sql = "Insert into TechSkillSet (EmployeeID,TechnicalSkillsID) values (" + techSkillsCheckListBox2.CheckedItems[x] + " , " + FirstnameText.Text.ToString() + " , " + Lastnametext.Text.ToString() + ")";
}
{
|
|
|
|
|
Hi , im developing an application its all working fine untill recentrly i got an error:
"error creating window handle" ,
so i was googling on the subject and i found out it happens when youre application is using 2 many controls
and thats indeed my case , so the solution was to replace the controls by drawing directly to the graphics of the parent control instead of making new child controls , for example if i have a panel , and i got like 1000 labels inside that panel , the idea is to do something like:
Graphics g = Graphics.FromHwnd(mypanel.Handle);
g.drawString(string,font....);
instead of adding 1000 labels to the panel.
ok so here is the problem i am trying to adopt this technique but i found out that in cases when i minimize
the window and then resize it back i see that all my drawings are gone , or when the panel uses the autscroll
when it appends the scroll bars same thing happens
all the drawings are gone ,
so my question is, is there any way to make these drawings stay permenently on the control , or i will have to make many eventhandlers and repaint evrything evrytime something happens....
or is there any other solution for this kind of problem thanks.
Net
|
|
|
|
|
this problem comes when u r not disposing objects properly.so
dispose the objects properly and try to repaint again.
rahul
|
|
|
|