|
yes I've tried almost everything between 1k and 1mb, read speed stays the same..
|
|
|
|
|
just now I figured this part out:
when I use the FileStream, I cannot access the actual video files (VTS_01_0n.VOB) - I get an IOException. As I said, if I run a DVD app (powerdvd for example) it unlocks these files, and I can read them. This does not happen in c/++ using the lowlevel io routines.
I close the DVD app before running mine, so it's not in the way.
Now, if I don't unlock the files though, the ones I read I get the same performance with c# and c++. (I can only read the 30 mb VOB file for the title, and not the actual 4+gb of movie, but it's enough for an estimate).
So, I guess FileStream does some checking on the files it should read for dvd copy protection or something - it lets me read only if the files have been unlocked. Does this mean that maybe even when they are unlocked FileStream goes through something extra when reading, maybe some decoding? If so, what else can I use in c# instead of FileStream to do the job?
|
|
|
|
|
I'm not clear on what you mean by locking..
If you mean CSS protection, yes you will need a valid player to unlock the file if it is encrypted (this is why DeCSS is so poplular because it has stolen, valid keys), if you mean file system locking for un-encrypted discs, you are locking the file with this line:
FileStream f = new FileStream(fl,FileMode.Open, FileAccess.Read, FileShare.None,16384);
FileShare.None means that you are not willing to share access to this file with any other process. Also, ensure you are closing the file stream after use by calling the f.Close() method, or by wrapping your code in a using block.
|
|
|
|
|
yes, but that's not the point. I'm not sure what FileStream does, because:
- the file is readable with low level c routines (_open, _close etc)
- the same file is NOT readable with FileStream, under the same conditions.
- the file becomes readable by FileStream ONLY if i launch a DVD app.
what does this mean? does it mean that filestream checks to see if a file is a dvd css encrypted file and, if it is, it decrypts it while reading? that would explain the performance loss and the fact that it won't read files from a locked dvd, but it seems too far fetched to me. I can't come up with any other explanation though..
I should probably check tha data I read (i'm not interested in it...) and see if _read and FileStream.Read return different data - that would mean that FileStream DeCSSs dvd data - if the files have been unlocked by another app. I'll try.
The point however is that if FileStream actually decss's the file, it does much more (even though I never asked for it) than simply reading a file from disk, and giving me the raw data. An alternative to FileStream?
|
|
|
|
|
so I tried..
the data that comes out (as it should be expected) is the same. However, there still is the problem that filestream will not read a dvd file if it hasn't been previously unlocked by a dvd app, saying "can't read the file is encypted", and the very poor performance. While I can imagine that it checks for dvd protection, I still can't see why it's so slow.
I'll write the reading stuff in c++, I guess.
|
|
|
|
|
The best thing you can do is take a look at the IL for the FileStream class and its superclass from which it inherits functionality. It's the only way to know for sure. Just use ildasm.exe from the .NET SDK and open mscorlib.dll from %SystemRoot%\Microsoft.NET\Framework\v1.0.3705.
Reminiscent of my younger years...
10 LOAD "SCISSORS"
20 RUN
|
|
|
|
|
Hi, All:
I am writing my FIRST Windows Form Application in .NET to edit my MS Access database. In this Access DB, I have a table with two columns: EquipmentID and EquipmentDescription. Some other tables use the ID to refer the equipment. This application supports multiple users at the same time. That mean that it could be more than one user add new equipmment. I use in-memory DataSet to get user's input and then call Insert/Delete/Update methods. I am debating that whether I should use Access AutoNumber for the ID field, or I should just use DataReader to get the Max ID used, then Add 1 to create my new ID. The AutoNumber makes things simpler, but if I try to merge to DB later, I will have a lot of headaches. If I assign my own ID, I might have conflict with other users and fail the INSERT.
So what is the typical way to achieve this, I know a lot of people have done this, please give me some ideas. Thanks in advance.
Dion
|
|
|
|
|
I'm doing a Win32 (commercial) application currently and this is a simplified view of how I do it.
For inserts:
- get user input from screen
- call business class to do validation, etc...
- business class calls generic data layer passing GUID as primary key
I use the GUID class to prepare a unique number. This way it will work for several users.
For updates:
- user selects a certain row
- business class uses this primary key to retrieve data along with a concurrency ID. This could be a timestamp in SQL, but I'm using another GUID instead.
- user does edit
- business class calls data layer, passing editted rows fields, GUID and concurrency ID
- data layer checks that the current concurrency ID still matches the one in the DB and then does UPDATE.
HTH
Cheers,
Simon
"The day I swan around in expensive suits is the day I hope someone puts a bullet in my head.", Chris Carter.
animation mechanics in SVG (latest pic 1) (latest pic 2)
|
|
|
|
|
Is there a way to make a certain column in the datagrid fill up to a 100% in the datagrid?
|
|
|
|
|
Not dynamic (before connecting DataSource):
datagrid.PreferredColumnWidth=datagrid.Width
Dynamic (only if You use DataGridTableColumn) in Resize event of DataGrid:
datacolumn.Width=datagrid.Width
but - remember about rowheader and vscrollbar width.
Hi,
AW
|
|
|
|
|
Hi all
I have a couple of quick questions:-
1. What do I do to allow my code to process one section of code at runtime and one section of code at design time?
2. Is there a forms collection? Basically I have an MDI app where I will require to shut down all the windows that have been opened programatically upon a certain user action.
Thanks in advance
ANdy
|
|
|
|
|
Almost every peace of code in windows programming is processed at runtime
well for this problem. u may save the references (pointers) of the currently
open forms in a hashtable or in any dynamic datastructure(e.g list) and
upon an event (e.g button click ) u just iterate that list and close the
forms by calling the appropriate messagecall.
bye
|
|
|
|
|
1. Use DesignMode property of components
Hi
AW
|
|
|
|
|
Here's a link from MSDN that deals with a similar subject. Perhaps it will help.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnwinforms/html/reaworapps1.asp
Jim Stewart
|
|
|
|
|
I am developing a web app that calls on the execution of an external application. The code compiles with no errors, however, the external execution is never implemented.
I am not at all sure what I am doing wrong. I've done the same thing using a windows form and it works. Could it be a security issue? Is it how I'm calling on the external application?
Me, wrong!?! Nah, you just need to change your thinking to make me right.
|
|
|
|
|
TeraCoder wrote:
I am developing a web app
Is this a WinForms embedded in IE app or an ASP.NET web app? The former you will need to setup the security policy via the .NET framwork configuration (mscorcfg.msc). The latter you will need to give the ASP.NET and the IIS user account execute rights for the process in question.
Hope this helps
MyDUMeter: a .NET DUMeter clone "Thats like saying "hahahaha he doesnt know the difference between a cyberneticradioactivenuclothermolopticdimswitch and a biocontainingspherogramotron", but with words you have really never heard of."
|
|
|
|
|
i face some problem in passing struct data type in web service style.
i create a web service:
---------------------------------------------------------------------
[WebMethod]
public string HelloWorld(System.Drawing.Color c)
{
if(c == System.Drawing.Color.Red)
return "RED";
return "NOT RED";
}
---------------------------------------------------------------------
i face no problem in generating web service proxy for the above code
by using wsdl tool.
i write a dummy test code:
---------------------------------------------------------------------
Service1 s = new Service1();
Console.WriteLine(s.HelloWorld(System.Drawing.Color.Red));
---------------------------------------------------------------------
i get the compilation error
dummy.cs(8,35): error CS1502: The best overloaded method match for
'Service1.HelloWorld(Color)' has some invalid arguments
dummy.cs(8,48): error CS1503: Argument '1': cannot convert from
'System.Drawing.Color' to 'Color'
any suggestion in solving this problem? thank you.
regards
yccheok
|
|
|
|
|
Sounds like you have defined another Color type or it theres a version mismatch...
MyDUMeter: a .NET DUMeter clone "Thats like saying "hahahaha he doesnt know the difference between a cyberneticradioactivenuclothermolopticdimswitch and a biocontainingspherogramotron", but with words you have really never heard of."
|
|
|
|
|
leppie, that's what I thought too.
Give it a try, there's something wierd going on.
Cheers,
Simon
"The day I swan around in expensive suits is the day I hope someone puts a bullet in my head.", Chris Carter.
animation mechanics in SVG (latest pic 1) (latest pic 2)
|
|
|
|
|
im looking too add some features to a simple console app that runs with my program via the command line's -console command. Im trying to find a easy way to make key words i.e echo,consolesave to change color when they are typed. i have a vague idea on how to do this. i also want any text with the "qoutation marks" to change color as well. Does anyone have any easy way of doing this? thanks alot
Jesse M
The Code Project Is Your Friend...
|
|
|
|
|
What happened to the RichTextBox?
MyDUMeter: a .NET DUMeter clone "Thats like saying "hahahaha he doesnt know the difference between a cyberneticradioactivenuclothermolopticdimswitch and a biocontainingspherogramotron", but with words you have really never heard of."
|
|
|
|
|
i figured it out... i just used a string array...and such !!
jesse m
The Code Project Is Your Friend...
|
|
|
|
|
ERROR : "The type or namespace name 'Net' does not exist in the class or namespace 'System' (are you missing an assembly reference?)"
I get this error on 'using System.Net;' and I'm obviously not understanding something quite important. I've been doing console-apps in C# for a while now and I have never bumped into this assembly-stuff before. I've searched the net and MSDN without figuring this out. Please help me
Edit: I figured it out at last!! (At least I think so)
Sprudling
|
|
|
|
|
I am looking for sample code where someone has used the Navigate2 method of the IWebControl2 object in C#.
Can anyone help me?
Thanks in advance for helping me out!
d
Darryl Borden
Principal IT Analyst
darryl.borden@elpaso.com
|
|
|
|
|
s.rod. has covered this many times here on the CP - look around.
|
|
|
|