|
momer wrote:
To test different cardreaders,I wrote a program to do the write/read data test
This makes sense.
momer wrote:
If there is a way to let me read 1GB(or some other number>1MB) data from a file
Well. See System.IO . BinaryReader , FileStream ... but it seems like you're looking for a
file-compare function in C#[^]
This posting is provided "AS IS" with no warranties, and confers no rights.
Alex Korchemniy
|
|
|
|
|
Hi!
Thank you!
//at present,before test,I must choose the
//sourcefilename which meet the proper size of the
//card to be test.The following code can do the right
//thing when I offer the correct sourcefilename.
......
FileStream sourcefile = new FileStream(sourcefilename,FileMode.Open,FileAccess.Read,FileShare.Read,4096,true);
File.Copy(sourcefilename,destfilename,true);
FileStream destfile = new FileStream(destfilename,FileMode.Open,FileAccess.ReadWrite,FileShare.ReadWrite,1024,true);
destfile.Seek(0L,SeekOrigin.Begin);
sourcefile.Seek(0L,SeekOrigin.Begin);
while (((i = sourcefile.ReadByte())==(j = destfile.ReadByte()))&&(i!=-1)&&(j!=-1));
if ((i==j)&&(i==-1))
{
mylusbs[threadnumble].Text = "PASS!";//currentlusb.text = "PASS!";
mylusbs[threadnumble].ForeColor = System.Drawing.Color.Blue;
}
......
? can you offer me a way to create 1GB file from 1MB file
Thanks!
momer
|
|
|
|
|
I don't quite understand how the above code is related to creating a 1GB file but...
Use FileStream and write your 1MB chuck 1024 times. I guess that would work right??
This posting is provided "AS IS" with no warranties, and confers no rights.
Alex Korchemniy
|
|
|
|
|
Hi!
Yes,the code I showed you is not related to creating a 1GB file,and I wish you can change it and let it be related to creating a 1GB file.
1MB*1024=1GB.Yes,you are right.
So,what the code should look like?
Best Regards!
momer
|
|
|
|
|
Hi~
WHat is the SqL Command for sql server 2000 wince which is used for rename a table of the database?
|
|
|
|
|
SQL questions should go in the SQL forum[^].
The answer is sp_rename . Its a system stored procedure. Check out SQL Server Books Online (installed on your machine). Also available on MSDN[^]
This posting is provided "AS IS" with no warranties, and confers no rights.
Alex Korchemniy
|
|
|
|
|
I really appreciate the emails from the code project members, concerning my unfruitful download of Borland C# personal edition.
I decided to delete it from my HD.
I would love to see for myself first hand, a program created in C# . I want to download it, try it,
just to see how it looks and feels. Can someone recommend a C# created program, that I can
download ? It can be about any subject matter. I just want to see it and try it out. It can be a quick little program , makes no difference what it's about.
Thanks again for the emails, I really appreciate the help.
Ron
Happy Trails .
|
|
|
|
|
A C# program can look and feel any way you want it to look and feel. You are not bound to using only the controls provided in the framework. There is a lot of C# code that can be helpful here at www.codeproject.com[^]. You can also visit www.gotdotnet.com[^].
Here's an example of a nice program created in C#: ASP.NET Web Matrix[^]
Trust me, .NET is the lastest and greatest things out there right now (unless you're doing driver developement or something that needs to be highly optimized). Almost everything is heading towards managed code.
This posting is provided "AS IS" with no warranties, and confers no rights.
Alex Korchemniy
|
|
|
|
|
Hello,
I wonder if there is a way to avoid events in a part of the code.
Exemple:
I use the event BackColorChanged of Button for some purposes.
And in a specific part of my code i also change the backcolor BUT i DONT want that the BackColorChanged event will be thrown.
Any ideas ?
Regards.
|
|
|
|
|
Well here's a quick hack: You can have a bool field to ingnore the next event. Reset the ignore field immediately.
if (!ignoreEvent)<br />
{<br />
}<br />
ignoreEvent = false;
Or you can derive from Button and fix whatever you are trying to do there.
This posting is provided "AS IS" with no warranties, and confers no rights.
Alex Korchemniy
|
|
|
|
|
Also, you could unsubscribe your event handler, process the specific part and then resubscribe the handler.
Event -= new EventHandler(handlerName);
Event += new EventHandler(handlerName);
www.troschuetz.de
|
|
|
|
|
|
Hi,
I using 5 radiobuttons in a GroupBox and 5 checkbox controls.
I looking to find wich index of the group of radiobutton and the index of the checkbox group
Can you help me ?
youssef
|
|
|
|
|
huh??? clearify.
The only thing I can think of is you might be looking for TabIndex for some reason. If you are looking for the one that is selected you need to check the controls by yourself.
This posting is provided "AS IS" with no warranties, and confers no rights.
Alex Korchemniy
|
|
|
|
|
Hi,
yeah alex is right... check for TabIndex and make sure of the selected tab index in the control box....
Suman
|
|
|
|
|
I need to create a program that runs in the background. When this program runs initially, it instantiates several objects that must be used by other executable programs.
The problem is: How can I pass a reference of objects that I created in "Program A" to "Program X"?
Any help, greatly appreciated.
|
|
|
|
|
If all applications/objects are in managed code u should take a look at Remoting technology.
If some of the objects/applications u have to use are not in managed code then I dont know which way u should go...but DCom comes to mind
|
|
|
|
|
Thanks for your input, .net remoting seems to be the right way to do it, but it is harder to troubleshoot and it will slow down performance due to the object marshalling that is done on every call (I could be wrong on this, but that's the idea I got).
I also looked into COM+ (I guess it's the equivalent of DCOM). Based on what I read, "COM+ creates an object after the client makes the first method call. The object is deactivated and released after the return of the method call. Subsequent calls for a deactivated object result in its reactivation. Therefore, to a client, it appears to be working on the same object, but COM+ actually creates multiple instances of the same class."
So the problem with COM+ is that it creates multiple instances of an object, but maybe I can get around this issue by setting the pool size to 1 because COM+ doesn't really destroy the object, it just deactivates and activates it.
Feel free to give any other advice you may think of.
|
|
|
|
|
I would suggest that you read about .NET Remoting, there is a lot of documentation on the web but the best place to start is MSDN. Please read the .NET Remoting Overview[^] which is part of the .NET Framework Developer's Guide.
- Nick Parker My Blog | My Articles
|
|
|
|
|
Is there a way to compile an application to use .NET 1.1 instead of .NET 2.0 beta? I can't find an option anywhere in the application to do this.
|
|
|
|
|
If you are targetting the .NET Framework 1.1 (binding to those assemblies), you should use the tooling that is provided for that. There have been many additions to the framework itself (2.0) that will not compile under 1.1.
- Nick Parker My Blog | My Articles
|
|
|
|
|
What Nick says is correct. There are a lot of new things in 2.0. If your app is complete backwards compat with 1.1 you can check out this link: Targeting a .NET Framework Version[^]
This link is more about 1.1 and 1.0 but the concept is the same.
This posting is provided "AS IS" with no warranties, and confers no rights.
Alex Korchemniy
|
|
|
|
|
Hi all.
This is the first time I'm tackling a remote application so I got a few doubts I wanna get straightened out before I get into it.
The first question that comes to mind is: what is the cost of keeping a registered channel during the client application's life. I mean, is it worth it to register and unregister a tcp channel everytime I call the remote object or is registering a channel when the app starts and closing it only when the user exits the client application a good enough solution?
Thanks
|
|
|
|
|
I bet the cost of registering and unregistering the channel is going to cost you more than the channel itself. In fact its not necessary to explicitly unregister the channel when the app closes. Framework will take care of that for you.
I would worry more about object lifetimes. From what you're saying it sounds like you are doing single call - you shouldn't have any problems.
This posting is provided "AS IS" with no warranties, and confers no rights.
Alex Korchemniy
|
|
|
|
|
Thanks for the input Alex.
Yes, my remote object will be a single call object and wont need to be a client activated object with state info, so I wont have to worry about the objects lifespan.
I'll register a client channel upon the client app's start and keep that one throughout it's whole life.
|
|
|
|