|
This is about c# .net compact framework problem.
I want to change a jpg file in the pocket pc 2002 emulator to
be a byte array and then pass it via web service for furhter
processing.
I use the FileStream codes to convert the jpg to byte array
as below, when an button onclick event. As FileStream is
supported by .net compact framework.
string strFullPath = @"\\Program Files\myApp\a.jpg"; // this
is a file that must exist in above emulator folder.
ln1: FileStream oImg = new FileStream
(strFullPath,FileMode.Open,FileAccess.Read);
ln2: BinaryReader oBinaryReader = new BinaryReader(oImg);
ln3: byte[] oImgByteArray = oBinaryReader.ReadBytes((int)
oImg.Length);
ln4: oBinaryReader.Close();
ln5: oImg.Close();
However, every time when running ln1, IO exception occured
and the emulator display error message "A device with the
same name is already on the network. Tap Start > Settings >
System tab > About > Device ID tab, change your device name,
and try again"
Any idea?
Thanks much!!!
Rene Xavier
|
|
|
|
|
Hello all,
Consider the following scenario:
We run a website (intranet) on W2K/IIS5. Ve validate userrights by comparing usergroups from NT against internal validation. Now we have to move to W2003 with NT, but we have no budget to alter the Intranet. Does anybody know how we:
Can have one component get the groups from NT aswell as AD?
Point us in the direction of some usefull samples that deal with this problem?
So far, all my searches was either an NT solution, or AD, and they would never mix
Thank you for taking the time to think with me on this,
Gerwin Postma
|
|
|
|
|
Hello,
I am doing a very simple web service and keep getting this error message. I have tried doing the hello world example as well by uncommeting the code, but this get the same message. I then tried doing a repair of my visual studio .Net thinking there was a problem with that, but still get the same error message. I cannot do any web services because of this. Can anyone help me?
The message l get is below.
Server Error in '/foodService' Application.
--------------------------------------------------------------------------------
The resource cannot be found.
Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly.
Requested Url: /foodService/Service1.asmx
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.1.4322.2032; ASP.NET Version:1.1.4322.2032
Thanks for your help in advance,
Steve
|
|
|
|
|
|
Hi there!!
I need to create a bitmap from a sequence of a movie.
What i need to do is to take the first column of each frame and to build a bitmap just to show it in a panel.
It is possible to do this without constructing a Bitmap file.
How can I do this?!!
Thanks very much
|
|
|
|
|
I suggest you look into the Windows Media SDK, as well as DirectShow. Both will have the capability to capture a frame of a movie as a bitmap, without having to construct a bitmap file on disk.
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: He has a funny face. And he's my son.
Judah Himango
|
|
|
|
|
Hi, how can I save an object in sqlserver by serialization without make a file in hard drive?
I wanto save it into an image datatype fild.
Thank you.
La realidad no es más que impulsos eléctricos del cerebro - Morpheus
|
|
|
|
|
You could use System.Runtime.Serialization.Formatters.Binary.BinaryFormatter to format your object into a stream. From the stream, you can get the byte[] making up the object. You are then free to write the byte[] to an image column in a SQL database.
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: He has a funny face. And he's my son.
Judah Himango
|
|
|
|
|
ok, but how can I know what capacity I need to use in the buffer (byte[])
Please write a code sample.
Thank you again!
La realidad no es más que impulsos eléctricos del cerebro - Morpheus
|
|
|
|
|
Once you've formatted your object into a stream of some kind, like so:
BinaryFormatter formatter = new BinaryFormatter();
System.IO.MemoryStream stream = new System.IO.MemoryStream();
formatter.Serialize(stream, theObjectIWantToSave);
You can then create and initialize the buffer like this:
byte[] buffer = new byte[stream.Length];
stream.Read(buffer, 0, buffer.Length);
Then you're free to hand that byte[] over to SQL to be stored in the image column field.
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: He has a funny face. And he's my son.
Judah Himango
|
|
|
|
|
Thank you so much!!!!!
This is what I looking for, but I only found file-serialization samples.
La realidad no es más que impulsos eléctricos del cerebro - Morpheus
|
|
|
|
|
|
Hi, is me again.
My class is:
<br />
[Serializable]<br />
public class clsCalendario<br />
{<br />
public clsCalendario()<br />
{<br />
<br />
}<br />
<br />
private int m_Codigo;<br />
<br />
public int Codigo<br />
{<br />
get { return m_Codigo; }<br />
set { m_Codigo = value; }<br />
}<br />
<br />
private string m_Nombre;<br />
<br />
public string Nombre<br />
{<br />
get { return m_Nombre; }<br />
set { m_Nombre = value; }<br />
}<br />
<br />
}<br />
I try to save an object into image filed in sqlserver litke that:
<br />
clsCalendario cal = new clsCalendario();<br />
cal.Codigo = 23;<br />
cal.Nombre = "Macho";<br />
<br />
System.Runtime.Serialization.Formatters.Binary.BinaryFormatter bf = <br />
new System.Runtime.Serialization.Formatters.Binary.BinaryFormatter(); <br />
System.IO.MemoryStream stream = new System.IO.MemoryStream(); <br />
bf.Serialize(stream, cal);<br />
byte[] buffer = new byte[stream.Length];<br />
stream.Read(buffer, 0, buffer.Length);<br />
this.Dataset.Tables[0].Rows[0]["CalendarioNormal"] = buffer;<br />
The problem is that buffer have only 0 (zeros) in all the array
I try to read the object from image datafile in sql server like that:
<br />
byte[] buffer = (byte[])this.Dataset.Tables["DBRRecurso"].Rows[0]["CalendarioNormal"];<br />
System.IO.MemoryStream stream = new System.IO.MemoryStream(buffer);<br />
System.Runtime.Serialization.Formatters.Binary.BinaryFormatter bf = <br />
new System.Runtime.Serialization.Formatters.Binary.BinaryFormatter(); <br />
clsCalendario miCal = (clsCalendario)bf.Deserialize(stream);<br />
MessageBox.Show(miCal.Codigo.ToString() + " - " + miCal.Nombre);<br />
But I have the follow exception:
Fuente: mscorlib
Tipo: SerializationException
Descripción: Se llegó al final de la secuencia antes de terminar el análisis.
Origen: System.Runtime.Serialization.Formatters.Binary.__BinaryParser --> Void Run()
OR
Fuente: mscorlib
Tipo: SerializationException
Descripción: La secuencia Binary no contiene ningún BinaryHeader válido, 0 causas posibles, secuencia no válida o cambio de versión de objeto entre la serialización y la deserialización.
Origen: System.Runtime.Serialization.Formatters.Binary.__BinaryParser --> Void Run()
What I do wrong?
Thank you!
La realidad no es más que impulsos eléctricos del cerebro - Morpheus
|
|
|
|
|
Try this instead:
clsCalendario test = new clsCalendario();
test.Codigo = 42;
test.Nombre = "hola";
BinaryFormatter bf = new BinaryFormatter();
MemoryStream stream = new MemoryStream();
bf.Serialize(stream, test);
stream.Flush();
byte[] buffer = stream.ToArray();
this.Dataset.Tables[0].Rows[0]["CalendarioNormal"] = buffer;
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: He has a funny face. And he's my son.
Judah Himango
|
|
|
|
|
Hi All,
Basically, I would like to encrypt the data/file at the client end and should be able to decrypt it at the server side. So that client/end user should not manipulate the auto generated file from the application(window). I've gone through some of the articles from the net and I have found three options to archieve this.
1) Symmetric
Adv: Can encrypt and decrypt using key values.
Disadv: If the end user decode the manage code then it is possible to identify the key values. Then they can also decrypt the file at their end.
2) Asymmetric
Adv: Can encrypt and decrypt using the public and private certificates.
3) Hash algorithum
Add and disadv more or less similar to (1).
So i prefer to go with point (2), i.e Asymmetric. If anyone has better solutions to archieve encryption and decryption of the file then please let me know.
Thanks & Regards,
Shiby Chacko
|
|
|
|
|
hi Shiby
Way 2 is the only way to prevent the Client from decrypting data, but if you go that far that the user will debug your client he´ll be able to intercept the data after generating and before sending. This is a securityhole you can´t close.
If the data you want to send gets larger you should go a middle-way between 1 and 2, because with asymetric encryption you can only encrypt small blocks. (e.g. with rsa 2048 bit you can encrypt 245 byte which will result in 256 encrypted byte). Encrypting with a asymetric algorithm is also slower than a symetric one. The middleway would be then: encrypt everything with a randomly generated symetric key and encrypt only this key asymetric for passing it to the server.
Azraelgod
|
|
|
|
|
Thanks for your response.
Is there any other way to archieve the encryption and decryption of file using manage code with security under consideration.
Regards,
Shiby Chacko
|
|
|
|
|
Hi there!
Well the most secure thing is to use a hybrid of 1 and 2. In this way you close the security hole of disadv of 1 and make the encryption fast(2..is slow).
First of all use Symmetric for the file.
As regards the key, you can use asymmetric encryption, so that the client can never get hold of the key value to decrypt!
You shall have 3 keys..
1...which will encrypt the data (symetric key)
2...private key to encrypt symetric key(1)
3...public key to decrypt symetric key(1)
In this way the client side, does not know that the encrypted symetric key, is really encrypted. So when he/she tries to decrypt, all he gets is garbage!
GaMBiT---> aND ReVeNGe WiLL Be
|
|
|
|
|
Thanks for your response.
Is there any other way to archieve the encryption and decryption of file using manage code with security under consideration.
Regards,
Shiby Chacko
|
|
|
|
|
Is there any way to assign a double click event to a radio button.
I found the ControlStyles bit, but not able to change it on the radiobutton.
Thanks so much in advance.
-Dwayne
*****************
"I know how hard it is for you to put food on your family." —GW
|
|
|
|
|
Unfortunately there is no double click event assigned for radio buttons. You can however create your own radio button control by trying to inherit radio button... maybe (I have never tried to modify standard controls myself).
But why would you assign double click event on a radio button? Radio buttons are to choose between two or more options.
Niklas Henricson
|
|
|
|
|
I am using the radiobuttons as a psudo-menu and the double click would launch the object from the nemu.
I thought about recreating it, with inheritance and changing. Not sure if it is worth it though.
Not a big deal, just suprised to see it gone from vb6.
*****************
"I know how hard it is for you to put food on your family." —GW
|
|
|
|
|
you could have a global variable, that would tell whether or not it was already clicked, and if it is clicked a second time within a certain amount of time, call your double click function. You would have to delay any code for the single click event (assuming you want the capability to single click it, which I wouldn't understand why you wouldn't need that capability) untill the possibility of the second click has already occurred. if you understand what I mean. I'm a beginner, but this is the workaround I would take.
|
|
|
|
|
Hi,
I have a project in which I access a mySQL Database and extract totals from it that are shown on a Form within a DataGridView. Can anyone tell me is it possible to access the values in the cells of this DataGridView from the Form, inorder to create an action dependant on a comparison of two of the cells values?
Thanks
Denis
|
|
|
|
|
hi guys i want to strip ceartin information from between tags but they differ in some things:
1:
<b><a.*?>(strip this 1)</a></b>
2:
<b>(strip this 2)</b>
3:
<b><a.*?><b>(strip this 3)</b></a></b>
Using the same regex object(i.e one expression for all 3), it got to be....
please can any one help
|
|
|
|