|
Thank you for your reply, and your solutions seems to work as well.
Is there a significant difference in the two approaches, or is it just a matter of taste ?
Cheers ?
|
|
|
|
|
That was a joke, notice the smiley? (I guess I should have put it inside the message.)
|
|
|
|
|
Hello experts,
I'm working on a system which would be able to dinamically load all kinds of multiplayer games.
In order for the system to know how to handle any game, I set up some ground rules using an abstract class named GameEngine .
Among other stuff, it contains an abstract ProcessMessage() method.
At first I thought of loading DLLs from a special folder, and analyzing every class which inherits GameEngine .
But then came another thought into my mind...
What if someone, instead of implementing a game, inherits GameEngine and puts down malicious code into ProcessMessage() ?
My first solution is not to read DLLs from a directory, but to read only a DLL that I will code... Whenever I want to add another game, I would update the DLL...
However, this prevents other programmers from adding games to my program...
What can I do?
Thanks in advance,
Shy.
|
|
|
|
|
You should allow plugins, regardless of the security risks.
|
|
|
|
|
You should sign your plugins ( DLLs ) using Signcode.exe and also use a Dotfuscator like tool to prevenet (as much as you can) your dlls from being disassembled to their original source code. Don't forget SecurityPermissionAttributes which also add another level of protection to your distributed plug-ins(DLLs). Checkout:
Web site: http://msdn2.microsoft.com/en-us/library/ab4eace3(vs.71).aspx
MSDN Library: Assembly Security Considerations
Hope this helps...
|
|
|
|
|
Hello!
I made a small C# application where you need to enter float numbers.
In the Dutch language/math they write floating point numbers with a ',' so for instance 1,5
In English they write a dot like 1.5
The strange thing is that in my application only floating point number with a comma are entered correctly.
Could someone tell me why this is? When I would enter 1.234 my program thinks it means 12.34, only when I type 1,234 this float is entering my program correctly...
Could anybody tell me what is happening here, I would prefer to use the English version only! But maybe .NET sees that I have a Dutch PC?
Ranger.
Novice
|
|
|
|
|
I have been looking around and found an interface called IFormatProvider but that this stuff is really complicated.
It has to do with local standards, how countries have different ways of displaying things.
Just like I expected.
Can you switch off this local way of interpreting information?
Ranger.
Novice
|
|
|
|
|
Ranger49 wrote: Can you switch off this local way of interpreting information?
Yes, if you pass CultureInfo.InvariantCulture as IFormatProvider.
-- modified at 8:08 Sunday 6th May, 2007
"Throughout human history, we have been dependent on machines to survive. Fate, it seems, is not without a sense of irony. " - Morpheus
"Real men use mspaint for writing code and notepad for designing graphics." - Anna-Jayne Metcalfe
|
|
|
|
|
dnh wrote: Yes, if you pass CultureInfo.InvariantCulture as IFormatProvider.
Thanks! This is exactly what I needed to know!
Ranger.
Novice
|
|
|
|
|
Pass NumberFormatInfo as the IFormatProvider.
Hope this helps...
|
|
|
|
|
Hi all,
i want to know how can I add data in a form from another form and display it in a datagrid after adding it to the first form
pleeease help
thanx
|
|
|
|
|
|
it will best if you use event handler in Child Form
and Call it from Parent Form.
class FrmChild
{
public event System.EventHandler addData;
.........
......
}
class FrmParent
{.....
private void btnSchduler_ClickEvent(......)
{
FrmChild obj=new FrmChild();
obj.addData +=new EventHandler(objServices_addService);
obj.ShowDialog();
}
private void objServices_addService(object sender, EventArgs e)
{
//write code to Add in Data Grid....
}
}
Sanjit.rajbanshi@wlinktech.com
|
|
|
|
|
First I decrypted your question
Then I found out that, you can do it by creating a new constructor which takes a datatable in the second form. Then from first form, you send the datatable to the second forms constructor where it is used as Form2.CustomDataGrodView.DataSource = datagridViewFromConstructor. Or you can add a property(public DataTable NewDataSource {get; set;}) or method like (UpdateDataSource(DataTable newDataSource)) then call these from your First Form with a new DataTable.
Hope this helps...
|
|
|
|
|
Hello,
I'm Trring to insert,update and delete throught a DataGrideView by using code
But I don't Know How .I need for help in how to select the appropriate Events.
Thanks.
Dad
|
|
|
|
|
try this article
Smile: A curve that can set a lot of things straight!
(\ /)
(O.o)
(><)
|
|
|
|
|
DataGridView.Rows.Add(...)
DataGridView.Rows.Remove(...)
DataGridView.Rows.Insert(...)
Checkout MSDN Library for these methods.
Hope this helps...
|
|
|
|
|
I have a question(s) that I hope someone can answer. I know how to make a picture box either visible or invisible and also how to load one image into it.
The questions are: Can more than one image be loaded into a picture box at one time? If so how is it done and how do you show each picture when needed? If it can't be done, what are my alternatives?
I'm trying to get three pictures into the same picture box area, and show each in turn as a specific button is clicked.
Thank you for any help or suggestions that are forth coming. 
|
|
|
|
|
Nope, you can't. Luckily, you have the ability to define variables
Declare and initialize three Image s and set the PictureBox 's Image property to the appropriate one when you need to.
|
|
|
|
|
Use Imagelist control.
Regards,
Arun Kumar.A
|
|
|
|
|
ImageList supports only specific number of colors and sizes which cause too many headaches.
just create a List or Collection or Image[] myImageList = new Image[] {img1, img2, img3};
And then in a loop, Button.Click event or Timer.Tick event use this code:
protected void UpdateImage(Image newImage)
{
//un-comment below lines if you are reading images from disk to prevent memory leaks
//if(myPictureBox.Image != null)
//{
// myPictureBox.Image.Dispose();
// myPictureBox.Image = null;
//}
myPictureBox.Image = newImage;
}
OR
protected void UpdateImage(IList myImageList, int newIndex)
{
myPictureBox.Image = myImageList[newIndex];
}
Hope this helps...
|
|
|
|
|
I have a screen shot that I want to analyze. Rather than do it pixel by pixel I am cutting up the screen shot into different sections. I want to analyze the palette and if a certain range of colors exist then do some additional processing.
<br />
Bitmap test = new Bitmap(pictureBox1.Image).Clone(new Rectangle(0,0,100,50), System.Drawing.Imaging.PixelFormat.);<br />
Color[] Entries = test.Palette.Entries;<br />
foreach (Color colorSearch in Entries)<br />
{<br />
}<br />
However, with the above code the palette has no Palette.Entries. Is there a way to force palette creation on the bitmap or do I need to use a different image format(Something I hadn't thought until now).
I attempted to try and force the Format8bppIndexed enum from PixelFormat, but that failed with an out of memory error. I'm assuming because there are more than 256 colors in the rectangle.
Another idea I had, but have no clue how to implement, is to change all the colors that are similar to a single color. But I think that still won't work without a palette. I honestly have no idea here.
|
|
|
|
|
I guess I answered my own question when I was writing. So just incase anyone else wants to know. Save the image as Gif and the Palette is created.
|
|
|
|
|
Hi friends!
I have no idea that how I can convert the image into the sketch style? Using the C#.Net.
Please suggest to me or give the helpful hints…………I will be very thank full to all of you……….this image conversion is a part of my FYP……..i used many algorithms for conversion of image but these algorithms are not efficient ...I have been trying since last month but i fail.....please guide me
Thanks Again!!
|
|
|
|
|
hi..
I downloaded a code from codeproject.com run the program, and when I click to find devices, it gives me PlatformNotSupportedException ... and Bluetooth.Net not supported on this device..
i looked everywhere and found out that bluetooth stack should be installed on my pc, well i looked for this bluetooth stack but found nothing, i'm using XP Home SP2 .. and C#.NET 2005 .. InTheHand.Net library for coding ... please help me out .. !
anyone worked on a bluetooth related project before .. ?
|
|
|
|