|
im really sorry for my typos - ill try avoiding them. as for the post, i told u that it doesnt only work for internet explorer but for any TCP/IP communication from ur PC. how?
|
|
|
|
|
does anyone know if there's a reason a FileSystemWatcher event always gives a lower case version of the file name?
I.E. if the file "Bob.tif" enters my watched directory, the triggered event contains the name "bob.tif".
Obviously this doesn't affect how windows works with the file, being case insensitive, but I'm currently working on a renaming application, so the case of the file name is important.
Any ideas?
|
|
|
|
|
The only work around I can think of is to use the Path class' GetFullPath method to retrieve the path from the file system, using the file path returned by the Watcher. You could then use the Path.GetFileName method on the returned string to get just the filename with extension.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Using GetFullPath on the e.FullPath still returns a lower case string, even making a FileInfo object on the e.FullPath still returns a lower case full path.
It would appear that if you start with a lower case file path, both Path and FileInfo commands will keep the name as lower case, so with the FileSystemWatcher returning only lower case names, there's no way to do it.
I've worked around this by getting the file info from the File System watcher when the file is renamed, and get the file name from the users input, but this still doesn't help when someone manually renames a file in the directory, it still returns the lower case name.
Is it just me, or is Microsofts choice to flatten file names to lower case with file system watchers kinda strange?
|
|
|
|
|
Hi,
I am developing a shape design app which will output a set of xy cordinates plus some other info. This info defines the shape.
I will then open a VS.net project, go to the design screen, and copy a custom control onto the Windows Form. This custom control will have a set of properties which can be entered manually as any other. However, I want to use the set of properties which I created using my design app above.
I am wondering if there is a standard for doing this? I could, for example, get the design app to output an XML file, and then give the custom control a property which specifies the XML file name, and read the data from there.
Maybe I could create a "DLL" type file, and embed it as a resource file in the project.
There are I think several ways to skin this particular cat, but I would like to use the standard, accepted method, if there is one.
Of course, if I could fire up the design app from VS.net, that would be all the better...!
Thanks in advance for any ideas.
Regards,
Gary.
|
|
|
|
|
So, I guess there is no standard
Or maybe I didn't explain what I meant clearly enough
I think I'll try XML - I ought to learn it, anyway
|
|
|
|
|
Hi,
I want to find out the exact location ,size and co-ordinate of line in the Page so can Multi-threading is also a way and if multithreading is the way then how it is possible?
i know that suppose there is a word document and i am writing any thing word is checking my spelling (called spell check),here there is two simultanious thread is working one is searching co-ordinate and another is checking the spelling so in my application also i use multithreading concept?
this is my theoritical assumption but does it work practically?
regards,
montu3377
|
|
|
|
|
Multithreading might not be the best implementation technique simply for determining the row and column numbers of your cursor. While it is nice to think of a thread as running concurrently with your main thread, in reality, they are still sharing processing space. If you do want to create a multithreaded application, then there are a few methods of going about this, some good, some really bad. First, you can start your thread when the application starts, and loop through it, constantly checking the cursor location. I think you'll find this is the worst approach you can take, as your thread will be interfering with your main application (and really you don't want a user to know it's even running.) Another approach would be to run a thread each time an event occurs which would possibly change the cursor location (such as a key press, or a mouse click.) These event handlers can simply start a thread, which handles finding the cursor location, and displaying it in your status bar (or wherever you want it.) This is better than the first approach, but I think an even better implementation would be to start one thread to check the cursor location, have it wait until an event is triggered, check the cursor, then go back into its waiting state until the next event is triggered. This way you don't have the overhead of constantly creating new threads to do the same task. Since this is purely a reader thread, I don't think you'll need locking mechanisms, but do a little research on it. If you do need to lock out the main thread, then you really aren't gaining much improvement over just calling a regular function when your events are fired.
Good luck
- Doug
|
|
|
|
|
Hi,
Yeah great.Here i really like urs second approach in which one thread is start to determine the co-ordinate location and another theard is getting the related co-ordinates or do some thing into event but here we can't use event becoz event is never been fired in whole process as user will not do any thing on the image,not even click the image and not even key pressing.
so i think here we can stuck in approach.
yeah but if you have done this kind of some thead applicaiton which will do same kind or related kind of applicaton then pls. send it some code so i can understand the things and naturally i am also doing research on the same thing as much as possible but if u have some sort of code then pls. provide me which increase my confidance level to implement the module.
thanks again.
regards,
montu3377
|
|
|
|
|
Hi,
I want to find out the exact location ,size and co-ordinate of line in the Page so can Multi-threading is also a way and if multithreading is the way then how it is possible?
i know that suppose there is a word document and i am writing any thing word is checking my spelling (called spell check),here there is two simultanious thread is working one is searching co-ordinate and another is checking the spelling so can here also i use this types of thing?
this is my theoritical assumption but does it work practically?
regards,
montu3377
|
|
|
|
|
threading has nothing to do with your solution, it's just an implimention detail that you may pursue. You're no closer to solving the problem, you're just expecting too much of threads ( as many people do ).
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
Hi,
I am facing problem in searching line in scanned image.Here i am describing the situation.
Suppose there is a page and in that page there is one ractangle at anywhere,but for that firstly we are finding Top line of the rectangle and here we are getting stuck becoz we are planning to start to searching from (0,0) left ,top of the page and go up to end of the whole page and by this way we want to find out the line and then after finding line we can find out rectangle,main problem is that now how we find out the line object?
regards,
montu3377
|
|
|
|
|
damn, is that really all one sentence ?
If the colour is unique to the rectangle, then scan for it. Otherwise, you'll need to do something funkier.
Read my image processing articles for how to iterate through a bitmaps bits in C#.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
Can anyone help me simplify the code below, given that MyObject and OtherObject comes from a 3rd party COM component (some DLL from somewhere)?
<br />
public class BaseClass<br />
{<br />
public void GetPropsforMyObject(ref myObjHere, CommonStuff commstuffhere)<br />
{<br />
myObjHere.CommonProperty1 = commstuffhere.Prop1<br />
myObjHere.CommonProperty2 = commstuffhere.Prop2<br />
.<br />
.<br />
.<br />
myObjHere.CommonPropertyN = commstuffhere.PropN<br />
}<br />
<br />
public void GetPropsforOtherObject(ref OtherObjHere, CommonStuff commstuffhere)<br />
{<br />
OtherObjHere.CommonProperty1 = commstuffhere.Prop1<br />
OtherObjHere.CommonProperty2 = commstuffhere.Prop2<br />
.<br />
.<br />
.<br />
OtherObjHere.CommonPropertyN = commstuffhere.PropN<br />
}<br />
}<br />
<br />
public class Class1 : BaseClass<br />
{<br />
public void Class1(CommonStuff commstuff)<br />
{<br />
MyObject myobj = new MyObject();<br />
<br />
GetPropsforMyObject(ref myobj, commstuff);<br />
<br />
}<br />
}<br />
<br />
public class Class2 : BaseClass<br />
{<br />
public void Class2(CommonStuff commstuff)<br />
{<br />
OtherObject otherobj = new OtherObject();<br />
<br />
GetPropsforOtherObject(ref otherobj, commstuff);<br />
<br />
}<br />
}<br />
Note that GetPropsforMyObject and GetPropsforOtherObject does almost exactly the same thing, except that the object being passed values to is different.
Neither can I modify MyObject and OtherObject because they are 3rd-party COM objects.
Any help would be appreciated
|
|
|
|
|
I'd add a constructor to the base class with the common construction code, and change Class1 and Class2 constructors to call the base constructor, like this:
public Class1(CommonStuff commstuff)
: base(commstuff)
{
//...this class does another thing afterward
}
or something like this.
Yes, even I am blogging now!
|
|
|
|
|
This still doesn't work because I have to pass on different objects.
I'll rephrase the question somewhat...
How do I simplify:
<br />
MyMethod1(Object1 obj1)<br />
{<br />
...obj1 does something...<br />
}<br />
<br />
MyMethod2(Object2 obj2)<br />
{<br />
...obj2 does the same thing as obj1, it's just a different object...<br />
}<br />
to something like
<br />
MyMethod(Param param)<br />
{<br />
...method does its thing<br />
}<br />
Where param can accept both Object1 and Object2, even if Object1 and Object2 are both from external COM components.
|
|
|
|
|
How about assigning all the properties in a loop by indexing the props with something like FieldInfo[] myfinfo = myObjHere.GetType().GetFields() [or rather GetType().GetProperties()]?
I have about the same problem, cause i want to load all properties of my objects from a file (key=value) dynamically without millions of myobject.prop1 = file.prop1 lines.
|
|
|
|
|
hello,
I have programed a MultiThreaded TCP server using TcpListener, TcpClient and NetworkStream. What can be the best approach to check the active connections and close the inactive ones? I am looking for some way so that when client
closes the connection only then the connection closes, regardless if the comunication has taken place or not for a long time. Is there any way?
Zishan
|
|
|
|
|
|
Actually I have an array of TcpClient and equal number of Threads for each client at the server. I have another thread (connectionDestructorThread) that is checking all these clients. If any client disconnects, this connectionDestructorThread should get the notification and aborts that client's Thread and free up resources.
I don't see how SendTimeout and ReceiveTimeout can help in this senario.
regards,
Zishan
|
|
|
|
|
Yes I did it!!! Thanks for the help.
Best Regards,
Zishan
|
|
|
|
|
Hi, I am planning in developing local applications using the architecture C# with MySql. Can anyone help me with the things I have to keep in mind?
I am using VS.net 2002, one question that I cannot determine because I have done this type of solution yet. If I use MySql as my database, is it required that I setup a Mysql server on the client pc that I am gonna implement my system?? How is it packaged then?
I have only tried using access and a client pc need not to have access when I install my system in it.
Can someone please help me on this? I am sorry for such a newbie question. Just want to cutdown through details thats why I am asking for external help and maybe get other cool suggestions. Thank you very much.
I just have to know
|
|
|
|
|
aarontlu wrote:
Hi, I am planning in developing local applications using the architecture C# with MySql.
Not the easiest thing to deploy. Unless you really need to use MySql, consider using MSDE, which is a free version of MS SQL Server, and very easy to deploy.
Yes, even I am blogging now!
|
|
|
|
|
I want to write a quoted string to a text file. The problem is that the string is in a variable and I can't work out how to get quotes around the text when written to a file.
Any suggestions appreciated.
Thanks
Stephen
|
|
|
|
|
If i understand you correctly, you are trying to include the " inside a string. Just escape the quote like:
string s = "this \"is\" an example";
This posting is provided "AS IS" with no warranties, and confers no rights.
Alex Korchemniy
|
|
|
|