|
I'm trying to change the timeformat to be based upon frames instead of time. I've read everything I could but I don't know how to create a proper GUID to give the mediaSeek.SetTimeFormat(ref System.Guid pFormat) function.
Can anyone help?
the GUID is: TIME_FORMAT_FRAME
|
|
|
|
|
I have a server that accepts a socket connections and accepts authentication requests in a specific protocol. I want to use this for an ASP.NET authentication. How can I make my ASP.NET app maintain a single connection to this auth server and send authentication requests to it?
I mean a COM object does not seem to be the right way anymore. What is the preferred .NET way of implementing this?
Thomas
modified 29-Aug-18 21:01pm.
|
|
|
|
|
I have a Control library that works fine when referenced between projects. But I created an install for the control library which deploys the Interop.SQLDMO.dll and SQLServerControls.dll (my output). The SQLDMO.dll (and references) are already installed, yet when I attempt to use or reference the SQLServerControls controls in a project that uses the installed dll it gives me a "file assembly Interop.SQLDMO, or one of its dependencies, was not found." I have validated that everything is there. I have also tried deploying the sqldmo.dll and sqldmo.rll files with the setup but to no avail. If anyone has any ideas I'd love to here em
|
|
|
|
|
Hi,
how to put a Text File into a Assembly as Resource, get this resource from assembly at runtime and write this file back to harddisk ?
.:Greets from Jerry Maguire:.
|
|
|
|
|
Step 1: Embedding a resource into your assembly
If you are using VS.NET simply add the text file to the project and in the properties for the file, set the Build Type to Embedded Resource.
If you are using the command line compiler add the following to your existing command line csc command.
/resource:mytextfile.txt,Name.You.Want.The.File.To.Have.In.The.Assembly.txt
Step 2: Getting a Stream object to your file
In Step 1 you either chose a name for the file or VS.NET created one for you. VS.NET names embedded files with this format: DefaultNamespace.Folder.Filename.ext if you just have the file sitting in the root of the project directory then it will just be DefaultNamespace.Filename.ext
First you need a reference to the Assembly object containing the file; this is usually done by getting a Type object for one of the classes in the assembly.
Assembly asm = typeof(MyClassInAssembly).Assembly;
Now that you have the assembly, you can get a Stream object for the file
Stream stream = asm.GetManifestResourceStream("name of my file in assembly");
Now that you have the stream you can do whatever you want with it; in your case you probably want to open up a FileStream and proceed to read the contents of stream and write them to the new FileStream.
HTH,
James
"And we are all men; apart from the females." - Colin Davies
|
|
|
|
|
I want to read Image field from my dataset and create Bitmap object and show it.I use this code:(Northwind database in Access)
int i = myDataGrid.CurrentRowIndex;
byte[] b = (byte[])dataSet11.Tables["Employees"].Rows[i]["Photo"];
if(b.Length > 0)
{
System.IO.MemoryStream stream = new System.IO.MemoryStream(b, true);
stream.Write(b, 0, b.Length);
Bitmap bmp = new Bitmap(stream);
if( bmp.Width > 500 && bmp.Height > 300)
.
.
.
But at the lone Bitmap bmp = new Bitmap(stream); this unhandled error happend:
Invalid parameter used.
Any idea?
Mazy
"If I go crazy then will you still
Call me Superman
If I’m alive and well, will you be
There holding my hand
I’ll keep you by my side with
My superhuman might
Kryptonite"Kryptonite-3 Doors Down
|
|
|
|
|
the Stream is an abstract base class. Whenever you want to use a stream, any type of stream i think your supposed to do this.
Stream stream = new MemoryStream(...);
try that.
Email: theeclypse@hotmail.com URL: http://www.onyeyiri.co.uk "All programmers are playwrights and all computers are lousy actors."
|
|
|
|
|
Nope.That does not help.
Mazy
"If I go crazy then will you still
Call me Superman
If I’m alive and well, will you be
There holding my hand
I’ll keep you by my side with
My superhuman might
Kryptonite"Kryptonite-3 Doors Down
|
|
|
|
|
i just looked it up in msdn, but the constructor u are using requires that you have two parameters:
new Bitmap(Stream s, bool useColorCorrection)
the constructor you are using does not exist, thats why u get the error. try this.
new Bitmap(stream, true);
if that doesnt work, then i haven't got a clue what to do.
Email: theeclypse@hotmail.com URL: http://www.onyeyiri.co.uk "All programmers are playwrights and all computers are lousy actors."
|
|
|
|
|
Thank you friend.I solved it.See the below replies.
Mazy
"If I go crazy then will you still
Call me Superman
If I’m alive and well, will you be
There holding my hand
I’ll keep you by my side with
My superhuman might
Kryptonite"Kryptonite-3 Doors Down
|
|
|
|
|
The byte array held in an Image in Access doesn't appear to be strictly the same format that you'd use in the stream.
When I used the example in this article:
File Upload in ASP.NET[^]
to upload pictures to my web site, I noticed that Access couldn't recognise that they were actually images, it just saw them as Byte arrays.
Paul
|
|
|
|
|
So couldn't you find any solution for it?
Mazy
"If I go crazy then will you still
Call me Superman
If I’m alive and well, will you be
There holding my hand
I’ll keep you by my side with
My superhuman might
Kryptonite"Kryptonite-3 Doors Down
|
|
|
|
|
Well... the solution for me was to upload it to the database using exactly the opposite code I used to download it from the database. ie. insert the picture as-is into an OLE object. It can't be read as a graphic by Access, but you can use the code you have to download it.
But if the picture is already in Access then you can't do that.
The alternative is to figure out what is different between the byte array you read from the database and the stream you're trying to create and adjust it.
One idea is to upload a picture to a database then write a piece of code to upload the same image as a byte array. Then write another piece of code to download both and compare the arrays.
Once you've done that, let us know what the difference is
|
|
|
|
|
pdriley wrote:
One idea is to upload a picture to a database then write a piece of code to upload the same image as a byte array. Then write another piece of code to download both and compare the arrays
Well,I do it for myself too.
pdriley wrote:
The alternative is to figure out what is different between the byte array you read from the database and the stream you're trying to create and adjust it.
I begin to try to figure it out.If I find it I'll tell you.
Mazy
"If I go crazy then will you still
Call me Superman
If I’m alive and well, will you be
There holding my hand
I’ll keep you by my side with
My superhuman might
Kryptonite"Kryptonite-3 Doors Down
|
|
|
|
|
Yohooooooooo,I found it.
When you insert bitmap from Access,it insert some extra byte at the beginning of array bytes.It insert exactly 78 bytes.So when you read them from your application you have to read from byte nember 78 to the end.Then it will be OK.
But don't forget its only when you insert BitMap Object from Access,not from your program.This number maybe different for different kind of data.
Mazy
"If I go crazy then will you still
Call me Superman
If I’m alive and well, will you be
There holding my hand
I’ll keep you by my side with
My superhuman might
Kryptonite"Kryptonite-3 Doors Down
|
|
|
|
|
Cool!
Assumedly those 78 bytes tell Access what kind of OLE object it has.
It'd be really useful to know how it does that so that you can add the 78 bytes when you're uploading to the database. Sounds like a lot of trial-and-error though, maybe another day.
Paul
|
|
|
|
|
I test it for NorthWind in sqlServer 7.0 but the same problem still happend.But maybe its because this database import from Access or it is old version of sql.
Mazy
"If I go crazy then will you still
Call me Superman
If I’m alive and well, will you be
There holding my hand
I’ll keep you by my side with
My superhuman might
Kryptonite"Kryptonite-3 Doors Down
|
|
|
|
|
Mazdak wrote:
this unhandled error happend:
Invalid parameter used.
Without the exception named I don't know what that means
But there are a few things that might be happening.
First, check the length of the byte array to make sure it matches the length of the data in the column; it might not have retreived all the data (just a guess)
Second, check the Northwind database to see if you have an updated one that removed the pictures from the database and replaced them with filenames. That is the case with my version of Northwind.
Last, if the database does indeed have binary data in it; make sure it is the correct binary representation of the bitmap. I vaguely remember that the pictures stored in the earlier versions of Northwind were serialized COM objects (in this case MS Paint bitmap objects). I don't think the Bitmap constructor knows how to deal with those.
James
"And we are all men; apart from the females." - Colin Davies
|
|
|
|
|
James T. Johnson wrote:
Last, if the database does indeed have binary data in it; make sure it is the correct binary representation of the bitmap. I vaguely remember that the pictures stored in the earlier versions of Northwind were serialized COM objects (in this case MS Paint bitmap objects). I don't think the Bitmap constructor knows how to deal with those.
Yes.That was the problem.But what about new versions?I don't have it now to test it.
Mazy
"If I go crazy then will you still
Call me Superman
If I’m alive and well, will you be
There holding my hand
I’ll keep you by my side with
My superhuman might
Kryptonite"Kryptonite-3 Doors Down
|
|
|
|
|
New versions of northwind store the images outside of the database and put the filenames for the images in the database.
I assume SQL Server's northwind still stores the images in the database since it doesn't have any other way of providing the files to other locations.
James
"And we are all men; apart from the females." - Colin Davies
|
|
|
|
|
This is actually what i suggested to friend doing database a couple years back having had similar problems when i knew nothing about SQL or ASP, but logic was the answer
MYrc : A .NET IRC client with C# Plugin Capabilities. See
http://sourceforge.net/projects/myrc for more info.
|
|
|
|
|
Hi all
If anyone is interested, and I'm sure that there are many can test my sound library for .NET. It is basically a wrapper for BASS, a multipurpose commercial quality sound library ( BASS Homepage [^]). Most of the functionality has been implemented.
I felt as this hasnt been implemented fully and there are still some bugs, it doesnt quite deserve an article yet. The library is accompanied with a Windows help file (nDoc) with most functions included.
If you have queries or suggestions, do not hesitate to contact me This is all work in progress, so dont complain .
Hope u have fun
Before i forget, the URL nBASS 0.9 Source, Bin & Doc[^]
I will try add a few examples when i have time.
MYrc : A .NET IRC client with C# Plugin Capabilities. See
http://sourceforge.net/projects/myrc for more info.
|
|
|
|
|
No problem.
43 68 65 65 72 73 2c
4d 69 63 68 61 65 6c
|
|
|
|
|
I have updated the source a bit after the Timer suggestion from James.
I have also included tests, a CD Player (plays from default CD drive) and a MOD player (plays range of formats) and a Stream Player (WAV files, MP3 ,OGG).
nBASS-0.9.1-src.zip[^]67kB
and i upload bass.dll[^]110kB
The tests/examples will should how easy it is to use
MYrc : A .NET IRC client with C# Plugin Capabilities. See
http://sourceforge.net/projects/myrc for more info.
|
|
|
|
|
Just and FYI...
There is already a free full .NET api wrapper for BASS, provided by them. If you want to check it out, you can download the source.
However, just compile it to a DLL and use if you want also.
Aalst
|
|
|
|