|
byte b0=GetByte();
byte b1=GetByte();
byte b2=GetByte();
byte b3=GetByte();
int vr= + b1;
if ((b0<<8+b1)==0x4F42)
{
int length;
if (littleEndian)
length=(b3<<24) + (b2<<16) + (b1<<8) + b0;
else
length=(b0<<24) + (b1<<16) + (b2<<8) + b3;
}
Now I have a value of length variable and to convert inverse direction. I'd like to gain b0, b1, b2, b3.
And those gained b0, b1 must ensure when apply (b0<<8) + b1 will be equal to 0x4F42 again.
That's what I want to. Before i try to simplify my problem but unfortunately i made it difficult to understand for you.
Please help me! Thank you so much!
|
|
|
|
|
Well if that's all then we gave you the answer countless times, right?
|
|
|
|
|
Hello.
I have got two ListViews in one Form.
When I select one DataSet in the first one, the second one will be filled with the correct data. Now I shall allow to select a dataset in the second one. But, when I do this, the selection in the first one is canceld. How can I awoid this deselection? Both seletions should be shown.
Regards, Taggi
How do you know, that Tagamoga has been assimilated by the borg?
"Recistunce ist fiutille."
Sorry for violating the english language.
|
|
|
|
|
There's a property on the listview - I can't remember what it's called, but it's something like "Always show selection". The default listview behaviour is to hide the selection highlight when the control loses focus (which is what happens when you click in the second control)
|
|
|
|
|
Thank you very much!
The Property is called "HideSelection" and has to be set on "false".
Thanks!
How do you know, that Tagamoga has been assimilated by the borg?
"Recistunce ist fiutille."
Sorry for violating the english language.
|
|
|
|
|
Hi All,
Is anyone happen to know zedgraph. I am working on it for a while but can not figure out how to set X-axis value as hour.
thanks.
|
|
|
|
|
Message Closed
modified 23-Nov-14 7:16am.
|
|
|
|
|
Hi stancrm, thanks for your help.
I have tried all of this but did not what I want.
what I want is that xaxis should show entire day as hour. let say
if from 12am to 11 pm and each minortic or majortic should show individual hour.
this what I am doing. I also know that xaxis depends on x value.If you can give me a hint
how do I frame time for the entire day as hour.
code>// Set the XAxis to date type
myPane.XAxis.Type = AxisType.Date;
// X axis step size is 1 day
myPane.XAxis.Scale.MajorStep = 1;
myPane.XAxis.Scale.MajorUnit = DateUnit.Hour;
myPane.XAxis.Scale.Format = "h tt";
myPane.XAxis.Scale.Min = hList[0].X - 1;
thanks again.
|
|
|
|
|
codeproject helped me many times
and i m thankful for that.
There is another question
when we create setup for windows application. can we set any property to hide the application database from the user. I want to hide the mdf file from the user.
thanks for all the reply in advance
Regards
Narendra Singh
(Jindal Tech Ventures)
|
|
|
|
|
No more than you can hide any other file - you could set the hidden attribute, but thats about all. Why not use encryption within your database?
Bob
Ashfield Consultants Ltd
Proud to be a 2009 Code Project MVP
|
|
|
|
|
can we define the hidden property at the time of creating setup project and how can i use the encryption in database
if u please define some more it will be very helpfull for me
Regards
Narendra Singh
(Jindal Tech Ventures)
|
|
|
|
|
The hidden attribute is a file atribute. It hides files from view for simple users. However more advance users uses 3rd party file manager or uses explorer setting "Show All Files". That settings shows files with Attribute: Hidden and System atribute.
One whay to fool users is to use .mdf database with custom extension (something.Dat).
If you realy want to prevent users from using your database, use on the fly encryption/decryption. I do not recommend to use hide attribute.
You could use windows folder and put somewhere or Use custom partition and use it to store database there. The second option is not recommended, because it is too hard and too long to successfully use it.
|
|
|
|
|
thanks saksida
now ill try to do encryption on database
can u provide me some links for startup
Regards
Narendra Singh
(Jindal Tech Ventures)
|
|
|
|
|
|
In reality there is no real way to hide the file, anyone with a bit of knowledge will ab able to find the file whatever you do. The only way to be secure is to use sql server encrytion, so just google that.
Bob
Ashfield Consultants Ltd
Proud to be a 2009 Code Project MVP
|
|
|
|
|
thanks ashfield
now ill try to do encryption on database
can u provide me some links for startup
Regards
Narendra Singh
(Jindal Tech Ventures)
|
|
|
|
|
Try Google. We have given you the advice, now its up to you to do it.
Bob
Ashfield Consultants Ltd
Proud to be a 2009 Code Project MVP
|
|
|
|
|
Ok thanks for your rplies
Regards
Narendra Singh
(Jindal Tech Ventures)
|
|
|
|
|
Hi all,
Dose any one know about documentation oF MSPastry Library under MSDN that could be utilized in C# code?
thnaks to you all in advances
|
|
|
|
|
There is no documentation since it's a Microsoft Research project.
|
|
|
|
|
Hey guys
As in the post below I'm busy writing a TCP server. The servers TCP communications are executed asynchronously.
Someone suggested that I take the received bytes out of the asynchronous callback and process it in a separate thread. Lets say I have 100 clients sending data to the server, I can't have 100 threads(one for each client) processing data cause that would defy the object of writing this server asynchronously.
So what I need to do is have a pool of lets say 5 threads for arguments sake that will process the incoming data of ALL the connected clients... I've never done anything like this and have no idea where to start, is this what thread pools are used for?
If anyone could clarify this or point me in a direction i would be really grateful
Thanks
Harvey Saayman - South Africa
Software Developer
.Net, C#, SQL
you.suck = (you.Occupation == jobTitles.Programmer && you.Passion != Programming)
1000100 1101111 1100101 1110011 100000 1110100 1101000 1101001 1110011 100000 1101101 1100101 1100001 1101110 100000 1101001 1101101 100000 1100001 100000 1100111 1100101 1100101 1101011 111111
|
|
|
|
|
Yes. Check out SmartThreadPool 2.0. We're using it at work, and it's absolutely tits. I think the latest version is on CodePlex.
.45 ACP - because shooting twice is just silly ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001
|
|
|
|
|
John Simmons / outlaw programmer wrote: and it's absolutely tits
I agree, I use it on a different project but not quite like this. I was actually busy brushing up on that article
Harvey Saayman - South Africa
Software Developer
.Net, C#, SQL
you.suck = (you.Occupation == jobTitles.Programmer && you.Passion != Programming)
1000100 1101111 1100101 1110011 100000 1110100 1101000 1101001 1110011 100000 1101101 1100101 1100001 1101110 100000 1101001 1101101 100000 1100001 100000 1100111 1100101 1100101 1101011 111111
|
|
|
|
|
I'll second SmartThreadPool. We use it to hive off our Tcp processing, and it just works.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
Hey Pete, long time since we've spoken
Pete O'Hanlon wrote: We use it to hive off our Tcp processing, and it just works
So you've done this before?
Here's my PacketReceivedCallback:
private void PacketReceivedCallback(IAsyncResult result)
{
IOClient client = (IOClient)result.AsyncState;
int bytesRead = client.Socket.EndReceive(result);
if (bytesRead != 0)
{
lock (clientLock)
{
StringBuilder sb = new StringBuilder();
if (client.IncompleatePacket.Length > 0)
{
sb = client.IncompleatePacket;
}
foreach (byte CurrentByte in client.ReadBuffer)
{
if (CurrentByte == EmptyByte)
{
continue;
}
if (CurrentByte == PacketTerminator)
{
PacketReceived(client, sb.ToString());
bytesReceived += sb.ToString().Length;
BroadcastPacket(sb.ToString(), client);
sb = new StringBuilder();
client.IncompleatePacket = new StringBuilder();
}
if (CurrentByte != EmptyByte && CurrentByte != PacketTerminator)
{
sb.Append((char)CurrentByte);
}
}
if (sb.Length > 0)
{
client.IncompleatePacket.Append(sb.ToString());
}
}
client.Socket.BeginReceive(client.ReadBuffer, 0, client.ReadBuffer.Length, SocketFlags.None,
new AsyncCallback(PacketReceivedCallback), client);
}
else
{
CloseConnection(client);
}
}
The way I see it is I'll have a collection, possibly a List<string> , in my IOClient class. Instead of trying to split the packets up in the callback I'll call MyStringList.Add(Encoding.ASCII.GetString(client.ReadBuffer,0,bytesRead));
Then my SmartThreadPool will sit and take a piece of data from that list and strip out the individual packets more or less like I'm doing in the above snippet... Is that more or less how its done?
And then would you mind telling me how I make the smart thread pool do this in the most effiecient manner? Like i told JSOP, I've used SmartThreadPool before, but not quite like this...
Thanks bud
Harvey Saayman - South Africa
Software Developer
.Net, C#, SQL
you.suck = (you.Occupation == jobTitles.Programmer && you.Passion != Programming)
1000100 1101111 1100101 1110011 100000 1110100 1101000 1101001 1110011 100000 1101101 1100101 1100001 1101110 100000 1101001 1101101 100000 1100001 100000 1100111 1100101 1100101 1101011 111111
|
|
|
|