|
Thanks for your answer. I know this but the problem is the webpage that I want to download. It is the image search of google. www.image.google.com
As it can be seen, there is a small camera icon beside the search button. When I save the page, this icon will not apear in the saved page.
|
|
|
|
|
Did you are did you not use your browser (not your code) to save the source of that link to a file?
Once you did that, did the icon show up or not?
|
|
|
|
|
Hi and thanks for your reply. I saved the page with IE but the button is not there. I just tried to save the page with mozila firefox. It downloads all of the icons and also the icon for the camera that I need, but still when I open the saved page using dreamweaver I am not able to see the icon. I need to find it because I want to change it by the code.
|
|
|
|
|
hosseinDolat wrote: It downloads all of the icons and also the icon for the camera that I need
Again...that is NOT possible in the context of your original question.
You CANNOT put an icon into a string.
So either it stored the text (string) of html, with the links or it saved a tree (one or more files some of which are icons.)
So your steps are
1. FIRST identify exactly what is that you think that you need to download
2. Fix DownloadPage() do to that.
|
|
|
|
|
hi guys , i'm wondering if we have an event for a clicking on the space of the datagridview . i mean , let guess we have 5 rows in the datagridview then after the last row there is still a space from the bottom of the datagridview to the last row .
i want to know if we have an event for that empty place(space) , noticed(i dont want to click the cells ) i just wanna a click events for the empty place .so if i clicked the empty space on the datagridview sth w'll happend.
&
i have used the click and mouse click events but they do double thing , that mean if you click on the row they'll work and also on the empty space .
i hope you get what i mean ?
|
|
|
|
|
You'll have to use the HitTest method to get a HitTestInfo object containing information about the DataGridView element existing at the clicked mouse coordinates.
There are two ways to tell if the blank area beneath the rows was clicked. Both are shown in the code fragment.
private void dgv_MouseClick(object sender, MouseEventArgs e) {
Debug.Print("{0}", dgv.HitTest(e.X, e.Y).Type);
Debug.Print("MouseClick was Nowhere {0}", dgv.HitTest(e.X, e.Y) == DataGridView.HitTestInfo.Nowhere);
}
Alan.
|
|
|
|
|
Hello
In Windows 7, files explorer tree, we have default locations:
- Favorites
- Libraries
- Computer
- Network
Question:
I need create my new location in explorer tree
Target effect:
- Favorites
- My_Folder ( loctaion: D:\My_Folder - with my icon )
- Libraries
- Computer
- Network
This is possible in C# ?
What I need to start ?
Thank You
Mark
|
|
|
|
|
mt1024 wrote: In Windows 7, files explorer tree, we have default locations:
- Favorites
- Libraries
- Computer
- Network
If you're referring to the default save location in a save-dialog, check this[^] out. If not, please post a screenshot to clarify
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
|
Ah, those are called "Shell namespace extensions". There's an example here[^], along with this warning:Editor's Update - 6/23/2006: Because shell extensions are loaded into arbitrary processes and because managed code built against one version of the runtime may not run in a process running an earlier version of the runtime, Microsoft recommends against writing managed shell extensions and does not consider them a supported scenario. A commercial alternative would be EzNamespaceExtensions[^], but the recommended way is still to use a non-managed language.
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
Thanks You for Your help. 
|
|
|
|
|
As you know, in Entity Framework Repository Pattern we have new DbContext(or object context) in each entity's instance.
Is it OK to implement Repository Pattern with Singleton to have the same DbContext in each entity's instance? If so, could you please post some references ?
Thanks
Read more about Repository Pattern :
http://www.remondo.net/repository-pattern-example-csharp/[^]
|
|
|
|
|
Mohammad Dayyan wrote: Is it OK to implement Repository Pattern
I haven't used the EF, but I'd assume that these "features" would already be in the implementation.
What do you think you will gain from the added patterns that's not there in EF? And why do you want a singleton, and not a simple static class?
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
Well
there are some reasons that you could find them with Google.
Eddy Vluggen wrote: What do you think you will gain from the added patterns that's not there in EF?
my reasons :
With Repository pattern we could hide DbContext(or ObjectContext) in UI layer for UI programmers and the they don't need to work with DbContext directly.
otherwise, for each entity we have to write Update, Delete, Insert, ... methods. So with repository "Don't Repeat Yourself"
Eddy Vluggen wrote: And why do you want a singleton, and not a simple static class?
Static class is an instance for all, and it has the same position in RAM of system.
but Singleton has a static field and we can have different instances of our class, but we prevent coupling
|
|
|
|
|
Mohammad Dayyan wrote: there are some reasons that you could find them with Google.
The answer to the question can probably also be found with a lot of Googeling. Like I said, I have no experience with the EF, just thought I'd try to formulate half an answer and see how far we could get, since the rest of the members seem to be stuck in the lounge.
Easiest strategy to verify the idea is to have you convince me that your approach is the correct one; since you already have the arguments, that'd probably be easy. If one can explain the motivation behind a solution, they'll at least have considered and weighed all (known) options. No, that's not a guarantee that it's the most optimal solution, but it is an indication that it is a the most ideal at the time of implementation.
Mohammad Dayyan wrote: With Repository pattern we could hide DbContext(or ObjectContext) in UI layer for UI programmers and the they don't need to work with DbContext directly.
That implies that they will bother you whenever there's a need for a change in the intermediate class. At a previous location, someone had the same bright idea on a SqlConnection , killing the possibility of hooking up a SqlTransaction . If one learns to program, one should know what a IDbConnection is, and how to use it - hiding it had no extra value for us, only downsides. Convince yourself that such is not the case for your DbContext.
Mohammad Dayyan wrote: otherwise, for each entity we have to write Update, Delete, Insert, ... methods. So with repository "Don't Repeat Yourself"
Really? Looks like I won't be using EF for a while then, I don't like to do repetitive tasks that can be automated. Mostly because I'm known to make mistakes, and the computer does not. Doesn't the EF create "entities" to work on that translate into those kind of queries automatic? If not, you got a good point here, would be in violation of the DRY-principle.
Mohammad Dayyan wrote: Static class is an instance for all, and it has the same position in RAM of system.
but Singleton has a static field and we can have different instances of our class, but we prevent coupling
Why, you planning on using other databases? A static class would suffice IMO; even if you DO use another database, you'd be changing the connectionstring, not the class.
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
Mohammad Dayyan wrote: <layer>Repository Pattern
Repository Pattern is just applying a new name to an old idiom - a database layer. And yes you should have a database layer.
Mohammad Dayyan wrote: with Singleton to have the same DbContext in each entity's instance?
Is is ok to use a Singleton? I doubt it.
(from your other post...)
otherwise, for each entity we have to write Update, Delete, Insert, Reposit
Not sure what you think you are doing but you are going to need to do that regardless.
Mohammad Dayyan wrote: <layer>Static class is an instance for all, and it has the same position in RAM of system.
but Singleton has a static field and we can have different instances of our class, but we prevent coupling
As stated that is basically all wrong.
First classes, not data, all exist as a single instance (again the class and not the class instance) in memory excluding AppDomains.
Second in modern OSes the OS moves applications, everything including data, code and OS management stuff associated with application around all the time including moving it to the hard drive. So it can never be said to be in one place in the RAM.
Third class instances (not the class this time) are managed by the C# heap and it can move them around in memory. So it won't even be in the same place in virtual memory.
Fourth, although a Singleton has a rigid definition the conceptual idea of a 'single' instance can take many forms, including implementing access via a static class.
Fifth, none of that has anything to do with coupling.
I suspect that you should at least first attempt to write the Repository code. AFTER you complete that then you can consider the following
1. Are threads involved?
2. Is there any point to using a singleton?
If the answer to the first is no and the answer to the second is yes then you can use a singleton.
|
|
|
|
|
|
For a C# 2010 windows service I need to check to see if files exist in a speciifed directory location at specified time intervals. If file(s) exist in the specified location, I need to accomplish the following steps:
1. I need to call some specified code for updating the database,
2. I need to find a way to indicate the files where already accessed without moving the files from their original location.
3. I need to know how to setup the windows service.
Thus I am wondering if you can tell me and/or point me to a reference that will tell me how to accomplish my goal using a windows service? I could use a different utility if you think it is better than use a windows service.
|
|
|
|
|
2) You may be able to set an attribute, otherwise you may need to store the file info in the database
3) How frequently? If not very frequently, like ten minutes or more, then a Windows Scheduled Task may suffice.
|
|
|
|
|
You should look at FileSystemWatcher
dcof wrote: 2. I need to find a way to indicate the files where already accessed without moving the files from their original location.
I would say that sounds like a stupid requirement. If it was me I would question that.
But you can just record the file names in the database.
dcof wrote: 3. I need to know how to setup the windows service.
You can google that.
|
|
|
|
|
In a C# 2010 desktop application, I need to create a dynamic directory
paths based upon the names of some documents I obtain from a web service. Basically if the name of the file type in an xml file is called 'Customer Inventory", I need to place these documents in a folder one level lower than the rest of the documents. Basically most files will end up in a path that looks like:
C:\temp\customers.
However the files that are marked in the xml file called "Customer Inventory", need to end up in a file directory path that looks like the following: C:\temp\customers\Customer Inventory.
Thus can you tell me how I can create the correct directory paths I need to work with?
|
|
|
|
|
dcof wrote: Thus can you tell me how I can create the correct directory paths I need to work with?
Use the Directory.CreateDirectory[^]-method.
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
|
My question is how can I place the files in one directory path or the second directory path that is longer? Basically the output files can go to 2 different locations. Can you tell or show me how to determine and actually place the different type of files in the different directory path locations?
|
|
|
|
|
This is all fairly basic stuff. What, exactly, is your background? How did you end up with this task? Judging by the number of questions you have posted recently, it seems that you are turning straight to Code Project for solutions.
|
|
|
|