|
I guess I am missing a fundamental C#/C++ difference here - I thought it is virtual since it's part of the IList<t> interface.
With Colleciton base, you mean the non-Generic collections?
I initially worked with a List<node<t>> member, forwarding almost all methods. However, I would also have to mirror the non-generic / generic relationship (i.e. I need generic access to this, otherwise *everything* including client classes turn into generics (without any benefit).
(I'd have to figure out how to do this anyway).
Is there a way to do that (easier)?
We say "get a life" to each other, disappointed or jokingly. What we forget, though, is that this is possibly the most destructive advice you can give to a geek.
boost your code || Fold With Us! || sighist
|
|
|
|
|
|
Just wanted to say thanks - that was the bit of information I desperately needed
We say "get a life" to each other, disappointed or jokingly. What we forget, though, is that this is possibly the most destructive advice you can give to a geek.
boost your code || Fold With Us! || sighist
|
|
|
|
|
|
I am working on a simple project that requires the end user to upload files to a web server and specify some keyword and other document information. I have been researching what is the most effective way to accomplish this that is 1. Simple, and 2. reasonably secure. Here are my thoughts to date:
Option 1 - Web Application:
This option would allow the user to select a file on the local machine and upload it to the server. This would (I believe) require a client side ActiveX component as well as it would require a user database to restrict the uploading of undesireable content to the site. Neither of which my client really want to do.
Option 2 - Clientside Application:
Store encrypted FTP credentials on the client and use FTP (or alternative? help here!) to send the files from the client to the server. This is simple and requires no user database. However the call to the FTP server is in clear text which theoretically could be packet sniffed. Apparently FTP transmissions can now be encrypted with SSL (and supported under .NetFramework 2.0) but I am not sure how this is configured and whether this is setup under IIS. There does not seem to be any option to EnableSSL under IIS (for FTP) for Windows XP (is this a Windows 2003 option only?)
Is there another protocol (say http) that can be secured under SSL to upload files? Suggestions (samples) on how I would how would connect to an IIS server? I would prefer to not have any server side components or web services and connect to the server directly from the client.
Any suggestions on approaches to address this problem would be appreciated.
Cheers,
David
-- modified at 17:14 Sunday 1st January, 2006
|
|
|
|
|
Hello,
i have a (probably) very basic design question.
I need to create a Person Object which holds information like Name, Email, Age, and Gender.
The problem is the Gender information.
There can only be "Man" and "Woman".
Soo i could either create a Man and Woman object which inherits from the Person object, or i could maybe store the information as an int, boolean or maybe even better as an Enumeration ?
But i cant decide which is the "correct" way to do it.
The Man and Woman object will be completly identical except for their type (how they are declared - new Man() and new Woman() ..).
Or should I in this case go with the other option and store the information as an int/boolean/Enum in the Person object ?
And is that how it is done when you have a value than can only be a certain different set of values ?
Or something completly else ?
There is no really difference as far as i can see, as i will either have to do checks like -
if (myObj.Gender == "Man"), or
if (myObj is "Man")
of course i could do some overloading of the methods soo i dont even have the if else - like HandleThis(Man obj) and HandleThis(Woman obj).
Maybe for the scalability, escpecially if it had been other information i had to store which could change by time it would probably be best to go with the inhertiance example.
or maybe i should always go with that solution ?
To some of you this might be a stupid question, but i cant really decide.
Soo i hope someone can help me to tell me what is the "correct" way to do it and why.
Martin
Happy New Year everyone !
|
|
|
|
|
just use and enumeration, inheritance from a person object would be too much normalization...its very unlikely humanity will converge into anything other than a man or woman, so a simple enumeration would be perfect. You might consider not having a default constructor and instead have a consturcture that requires a gender initialization.
normailization is good, but there is always to much of a good thing...
|
|
|
|
|
I'd think you need to look to whether the Gender object will have any responsibility. If you are handling any methods such as:
if (myObj.Gender == "Man"), or
if (myObj is "Man")
you might want want to utilize the state or strategy patterns (GoF) instead. http://ootips.org/[^] or http://www.dofactory.com/Patterns/Patterns.aspx[^]
ed
~"Watch your thoughts; they become your words. Watch your words they become your actions.
Watch your actions; they become your habits. Watch your habits; they become your character.
Watch your character; it becomes your destiny."
-Frank Outlaw.
|
|
|
|
|
hello everyone and happy new year
i`ve got a task to write a client-server game (web application)
i`ve succeded if writing clent-server part and data tranfer (as an xml web service)
so, now i need actually game. and here is the problem!
how could i make a game field? i mean some kind of a board for example for chess, so that i could get event by clicking specific cell? suppose there is some easy way to do it, not making hundred of image buttons
what could you reccomend?
P.S. remember, THIS IS A WEB APPLICATION
|
|
|
|
|
Hi,
I have asked this question about a day ago and I was given a very good answer about some concepts I was not aware of-- Region.Translate, and Matrix.Transform. So I've been
experimenting with them and I'm able to now draw Rects and Translate and Rotate them
but I still haven't solved what I ultimately want to do...
/////////////////////
PointF pt_1 = new PointF(0,0)
PointF pt_1 = new PointF(100,100)
public void DrawLine(Graphics g)
{
SolidBrush brush = new SolidBrush(Color.SteelBlue);
Pen pen = new Pen(brush, 10);
g.DrawLine(pen, pt_1.X, pt_1.Y, pt_2.X, pt_2.Y);
}
private void Form1_Paint(object sender, System.Windows.Forms.PaintEventArgs e)
{
DrawLine(e.Graphics);
}
////////////////////////////////////////////
How do I change to my own coordinate system and have it permanently stay that way?
That is, I want (0,0) to always be the center of the Form, no matter what event fires.
What I have (not the test code above) is a program that can draw vectors on an XY axis.
I can do it-- only because I've hard-coded the coordinates for the Graph Origin, which
besides being a lousy way to do things, also prevents me from any more progress....
Any (further) help would be greatly appreciated.. thanks
|
|
|
|
|
Since reading your post two days ago, I've tried implementing this in as many ways as I could think. Unfortunately, I just can't get it to stick. I think that you will have to translate the coordinates for every message/event that you receive.
Admittedly, you don't have too much work ahead of you. For messages/events that require painting, you only need to do the Graphics.TranslateTransform( Width / 2, Height / 2 ) call. For messages/events that have client coordinates associated with them, you'll need to subtract Width / 2 from the x and Height / 2 from the y . Finally, with messages/events that have screen coordintates, you need to call PointToClient(Point) and then subtract like the last call.
I would write three static methods in a helper class with signatures like:
Point CenteredPointFromClient( Point point, Form form );
int CenteredPointFromScreen( Point point, Form form );
void CenteredGraphics( Graphics g, Form form );
I wish a better solution existed. I don't think that it does because it would mess up the way that the .NET runtime draws child controls. Sorry.
"we must lose precision to make significant statements about complex systems."
-deKorvin on uncertainty
|
|
|
|
|
plz email me jema_r84@yahoo.com
im try to study it now..huhuhu
|
|
|
|
|
Have you thought about buying a book or searching the internet for tutorials.
My: Blog | Photos
"Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucius
|
|
|
|
|
Please see below on what I am trying to do...
Want to get the property value little differently...
Thanks in advance,
Shrini
<br />
class myItem<br />
{<br />
public myItem(){}<br />
public myItem(int EntryID)<br />
{<br />
_EntryID = EntryID;<br />
}<br />
int _EntryID;<br />
public int EntryID<br />
{<br />
get { return _EntryID; }<br />
set { _EntryID = value; }<br />
}<br />
}<br />
}<br />
class myItemList<br />
{<br />
public List<myItem> GetItems()<br />
{<br />
List<myItem> itemCollection = new List<myItem>();<br />
for(int i = 0; i < 5, i++<br />
{<br />
item.Add(i);<br />
}<br />
return itemCollection<br />
}<br />
}<br />
class myClass<br />
{<br />
public void ABCD()<br />
{<br />
myItemList myItems = new myItemList();<br />
List<myItem> Items = myItems.GetItems()<br />
<br />
<br />
<bold>WHAT I WANT TO DO IS HERE...</bold><br />
<br />
I know I can access the Items property like this...<br />
<br />
Items[0].EntryID<br />
<br />
But I want to be able to pass in the name 'EntryID' Dynamically...<br />
<br />
string fld = "EntryID"<br />
<br />
Items[0][fld]<br />
<br />
Is this possible?<br />
<br />
<br />
<br />
}<br />
}<br />
<br />
|
|
|
|
|
Yes, either by using reflection (a bit messy IMO), or implementing an index property in the myItem class:
int this[string key] {
get {
switch(key) {
case "EntryId": return this._EntryID;
default: throw new ArgumentException("No property with the name '" + key + "'.", "key");
}
}
}
---
b { font-weight: normal; }
|
|
|
|
|
Took me little bit of thinking... Ofcourse it is System.Reflection...
What I am doing is some what similar to DTS where you match field names from one database to another for transfering data...
Here I have to match Property names to fields and these names are coming from outside...
<br />
Type type = myItems[0].GetType();<br />
PropertyInfo info = type.GetProperty(PROPERTYNAME);<br />
System.Windows.Forms.MessageBox.Show(info.GetValue(myItems[i], null).ToString());<br />
|
|
|
|
|
Hello everyone!
Iam coding a little tool in C# which could be used as image downloader from websites.
Via httpget I retrieve the pagecontent of the entire website and put all that into a textbox objekt (like a console)
now I want to extract any "http:\\xxxxxxxxxxxxxxxxx.jpg" links and put them into a new string. But I have no idea.
can you help me?
|
|
|
|
|
regular expressions perhaps? you can do pattern matching to get the urls and such. im sure that there is a class out there that will download the actual source of a given webpage, you can then parse that source string to retrieve the href to jpg files. keep in mind that a lot of people are ussing CSS and there might not be any direct links in the source document, you might have to go to the CSS files to find jpg urls...hope thats what you were looking for.
|
|
|
|
|
Yes thats true.
but css is not the problem. the problem is javascript. to download images in javascript links i have to find out the name of the image file (eg: xxxxx.jpg) and then i have to build up a new string containing filename and url.
steps
-----
1. find out jpg filenames
2. build a new string containing filenames and url
3. filter big images (to avoid thumb downloading)
4. perhaps modify filenames (eg: xxxxxxx_thumb.jpg ----> xxxxxx.jpg)
5. download stuff
|
|
|
|
|
ger_creal wrote: I want to extract any "http:\\xxxxxxxxxxxxxxxxx.jpg" links and put them into a new string
Stay tuned for an article (that I'll be uploading very shortly) that will let you do this with ease!
/ravi
My new year's resolution: 2048 x 1536
Home | Music | Articles | Freeware | Trips
ravib(at)ravib(dot)com
|
|
|
|
|
|
I am working on my final year project of BS ( computer science) of University of karachi. My project is to deliver application's access rights to any users in the domain dynamically. I know this could be happen by accessing Group policy of any Organizational unit in which that user belong.
but the problem is that , i was unable to access group policy / software restriction policy in C# or any other .net language.
I am accessing active directory in c# using System.DirectoryService namespace. but this could not contain any support of accessing group policy. Pleas help me, my project deadline date is very near.
-- modified at 7:22 Sunday 1st January, 2006
|
|
|
|
|
Hello there!
I want to know is there any possible method to be notified when the computer (which is a member in a LAN) is disconnected?
The program is running on the computer, and I want to be notified when the computer is disconnected and connected.
Thanks
|
|
|
|
|
Hi,
On my C# winforms project I have received some fairly large rounded buttons from the graphics department. Since they are large I cannot cheat and take their rectangular outline as "hotspot" area for mouse enter/leave (to change cursor to hand, and back) and click.
So with other words the code Rectangle.IntersectsWith(Control.MousePosition) doesn't do it for me. I need some code that is Circle.IntersectsWith(Control.MousePosition) .
Did anybody encounter this problem, and has a simple solution for it? Or can give me tips how to handle this problem?
Tnx.
|
|
|
|
|