|
i saw ur articals but there is no article like filesystemwatcher?
|
|
|
|
|
He doesn't meant to search in his articles.
The link is allways in his Signature.
Very confusing off corse.
Try searching on the CP articles[^]
Or msdn doc[^]
All the best,
Martin
|
|
|
|
|
Hi all, I make a code to drag a text from a list to textbox but i want to insert it in a certin postion in the textbox how can i get the cursor position
merwa
|
|
|
|
|
Hello,
I think the SelectionStart property is what you are looking for.
All the best,
Martin
|
|
|
|
|
Hello merwa,
Martin is right, the mouse position has nothing to do with what you're trying to do, however if you're sure you want to get the mouse position, use e.Location for e is an automatically created mouse event argument for your control "textbox int this case"
Smile: A curve that can set a lot of things straight!
(\ /)
(O.o)
(><)
|
|
|
|
|
Hi, is there a way to use an enum as condition in an if statement. Say for example can I change the following code and use enum instead /thx:
string houseType = string.Empty; //is set to different housetypes
...
...
if(housType.Equals("detached house"))
..do something
else if(houseType.Equals("manor"))
..do something else
|
|
|
|
|
Sure:
enum HouseType {UNKNOWN, DETACHED, ... }
HouseType myHouse=HouseType.UNKNOWN;
...
if (myHouse==HouseType.DETACHED) ...
...
Now if you want enum values that are not valid identifiers, you need some special
trick, e.g. add Attributes to each enum value, and retrieve them using reflection.
|
|
|
|
|
Many thx Luc
|
|
|
|
|
Or use static class, like
class HouseType
{
HouseType(string){...}
string desc;
public string Description { get {return desc;}}
}
static class HouseTypes
{
static HouseTypes()
{
type1 = new HouseType("House of type1");
}
public HouseType Type1 { get {return type1}}
}
...
if(myHouse.HouseType == HouseTypes.Type1)...
It should have better performance then using attributes but it consumes some extra memory.
"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
|
|
|
|
|
Hi all,
Can any one suggest/guide me how to record and store the video captured by the system web camera. I want to record the video which captured by my web camera and want to store it in my local hard disk. I want to do this using c# as an desktop application.
I got some ssamples to capture the video only, but i need ideas how to store the videos.
Plz any one suggest me how to do it.
Thanks in advance
Know is Drop, Unknown is Ocean
|
|
|
|
|
For specific web cams you will have to look to see if their is an API command library that you can use. Or you can do a search on this site for: web cam. You will get many results, one being http://www.codeproject.com/cs/media/motion_detection_wc.asp[^]. Their is another example of a webcam article that I like better, but the search didn't come up with it.
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my homepage Oracle Studios[ ^]
|
|
|
|
|
Thanks for your reply. I will have an look on your suggestions. Thank you once again
Know is Drop, Unknown is Ocean
|
|
|
|
|
I'm trying to simulating a button containing in a form.By reading some reference articles,I'd seen that most of them suggested to use webbrowser control,and then acquire htmldocument2 dispatch to get IHTMLInputButtonElement interface.But I'm now doing real time system,it demanded to get infos as soon as possibly,so I must use multiple threads to solve it.From some articles,I heard that webbrowser control cannot be used in multiple threads environment.So what's the better way?
|
|
|
|
|
Hi friends..plz go through this pseudo code
I Included Requirid Namespaces
Dataset ds;--------------------------------------1
//static Dataset ds;-----------------------------2
protected void page_load(parameters)
{
ds = function in Data acesss Layer which retrives records from database and returns dataset.
populatedatagrid();
}
void populatedatagrid()
{
if(mydropdownlist.selectedIndex=0)
datagrid1.datasource=ds;
else
{
datagrid1.Datasource= here I performed filtering action using Row Filter Property and selected Index Value
}
}
void mydropdownlist_selectedIndexchanged(parameters)
{
populatedatagrid();
}
I am designing a web page where by default all records will displayed.but by selecting from dropdownlist I can filter the records.Later I thought its not right to perform the fuctionalities of the page_load event at each postback(unnecessry making connection to the database)..so i used Page.Ispostback to avoid that..so first time it worked fine but when i selected from dropdwn list it throws an error "object reference not set to an instance of object"..
reason for above error i understood(because in page load event i am returning dataset which does not happened at page post back)..so one of my friend commented the line no-1 and uncommented the line no-2 in above code..thus made dataset static..and it works
What I am not understanding is why making the dataset static solved the task..though HTTP is static?Is making dataset ststic makes the records to be saved at server?
Warm Regards,
Rahul Agarwal
-- modified at 7:28 Tuesday 12th June, 2007
|
|
|
|
|
First off, this is an ASP.Net question, not one specific to C#. You should post it to the ASP.Net forum for more timely response.
Now, unless you personally make some attempt to persist your data source (or reconnect and query it each time) across page turns, it will not persist itself. At the very least, you need to bind your data source to its control after each page turn (Postback or not), and at most - meaning if you don't want to reload your data after each page turn - you need to persist it statefully. The static variable is a bit much for this application, but it proves the point.
Is ViewState enabled for your dropdownlist? If you're doing filtering after your initial binding it won't really matter since you'll need access to your datasource, not the expression of the data in the control, but it's something to check.
Other ways to do the same thing would be to push the data source to ViewState manually, or use the Session or Application objects - it all depends upon your needs.
I would recommend looking up the ASP.Net page life cycle to better understand what happens each time a page is turned (whether it's a new HTTP Request or a Postback).
Good luck
The most exciting phrase to hear in science, the one that heralds the most discoveries, is not 'Eureka!' ('I found it!') but 'That's funny...’
|
|
|
|
|
Why doses C# not support Multiple Inheritances?
Is there any disadvantage?
Vikas Neema
|
|
|
|
|
hi...
check this:
#
What is multiple inheritance? What are its advantages and disadvantages?
Multiple Inheritance is the process whereby a sub-class can be derived from more than one super class. The advantage of multiple inheritance is that it allows a class to inherit the functionality of more than one base class thus allowing for modeling of complex relationships. The disadvantage of multiple inheritance is that it can lead to a lot of confusion when two base classes implement a method with the same name.
source link : http://www.possibility.com/epowiki/Wiki.jsp?page=CppInterviewQuestions
you can implement multiple interface instead of multiple inheritance
hope i helped
Tarek Elganainy
Computer and Systems Engineering Dept.,
Faculty of Engineering,
Alexandria University.
|
|
|
|
|
See the last post here:
Why no multiple inheritance allowed in C#? [^]
It reads:
This is an answer on this question, as posted on a C# FAQ by Chris Brumme:
1. Different languages actually have different expectations for how MI works. For example, how conflicts are resolved and whether duplicate bases are merged or redundant. Before we can implement MI in the CLR, we have to do a survey of all the languages, figure out the common concepts, and decide how to express them in a language-neutral manner. We would also have to decide whether MI belongs in the CLS and what this would mean for languages that don't want this concept (presumably VB.NET, for example). Of course, that's the business we are in as a common language runtime, but we haven't got around to doing it for MI yet.
2. The number of places where MI is truly appropriate is actually quite small. In many cases, multiple interface inheritance can get the job done instead. In other cases, you may be able to use encapsulation and delegation. If we were to add a slightly different construct, like mixins, would that actually be more powerful?
3. Multiple implementation inheritance injects a lot of complexity into the implementation. This complexity impacts casting, layout, dispatch, field access, serialization, identity comparisons, verifiability, reflection, generics, and probably lots of other places.[/]
As far as I'm aware, the only language that supports full MI on .NET is Eiffel.
Full Eiffel on the .NET Framework[^]
Kevin
|
|
|
|
|
i try to build a program in C# to lock a certain directory.
|
|
|
|
|
Hesham yassin wrote: i try to build a program in C# to lock a certain directory.
Good luck then!
Smile: A curve that can set a lot of things straight!
(\ /)
(O.o)
(><)
|
|
|
|
|
I am also saying Good luck..Tried sometime but not achieved
Regards,
Sylvester G
sylvester_g_m@yahoo.com
|
|
|
|
|
ha:-Dha
|
|
|
|
|
Hi ,
I want to access remote machines hardware , like CD-ROM Drive , WebCam etc.
But I am not sure where to look and frm where to start.
So can any one plz guide me to right direction ?
I am using sockets to access remote machine , so I am assuming streams are only way to get these hardware resourses , but how ?
Need help , thanks.
ZINK
|
|
|
|
|
This can be done in a few ways, and this is one of them (not necessarily the best):
Use System.IO.DriveInfo.GetDrives() to retreive all drives, then use a formatter to serialize the DriveInfo objects to the NetworkStream .
As for webcam and other devices, you're gonna have to code API wrapper classes, mark them as Serializable , and again, use a formatter to serialize them to the NetworkStream .
Regards,
Shy.
|
|
|
|
|
Hi ,
Shy Thanx for your reply.
Actually I dont want to get just the Devices name , but the actual device when u share your CD rom drive on netwrok , any one on netwrok can use ur drive and access th CD data in that CD rom drive.
So I want something like that .
Any sugestions ?
Thanks
ZINK
|
|
|
|