|
Hi
I have written a small program to search my computer for certain files. However, I use Vista which has UAC. Unfortunately there are plenty of places where the application can't reach because of permissions. So I decided to search around how to get past the permission problem. I found the following guide:
http://blogs.msdn.com/shawnfa/archive/2006/04/06/568563.aspx
As expected my app now asks when launched to get highest possible permissions when running. Unfortunately, this still prevents me from accessing the same folders. Any suggestions why that is? Have I lost control of my own system or something since it can't even access my own home directory?
|
|
|
|
|
There are folders on the disk that you cannot get to, no matter what accoutn you use. Your code is just going to have to deal with this eventuality.
If you've already made a manfiest file for your app, requesting admin priv's, then that's about the limit of what you can do.
|
|
|
|
|
Dave Kreskowiak wrote: There are folders on the disk that you cannot get to, no matter what accoutn you use. Your code is just going to have to deal with this eventuality.
besides those belonging to other users, what are they?
Today's lesson is brought to you by the word "niggardly". Remember kids, don't attribute to racism what can be explained by Scandinavian language roots.
-- Robert Royall
|
|
|
|
|
I can't think of a definitive list, but the first that springs to mind is System Volume Information. However, it would be fairly simple to get a list yourself. Just recurse, but print the directory name to the console if you catch an UnauthorisedAccessException. Leave it for a few minutes/hours and you have a list
|
|
|
|
|
Hi Dan,
I don't know them all, I trust C:\System Volume Information and C:\C:\Users\All Users\Start Menu are two of them.
Luc Pattyn [Forum Guidelines] [My Articles]
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets
modified on Sunday, June 12, 2011 9:20 AM
|
|
|
|
|
"System Volume Information" for one. I seem to remember there was another folder, but I can't remember the name right now.
|
|
|
|
|
Hi all,
Im not quite sure what i want to use for my problem so i thought maybe somebody out there has a good solution.
My situation is that i have a user control that, for example, displays a list of database entries such as messages. This control can be present in multiple forms that esentially need to be syncrhonised. For example, if an entry is added, edited or deleted in one control, all other controls need to be notified of this and know to look for updates.
As my subject may suggest I have thought of a global event that all instances can listen for, but have not tried yet as i dont know if this is a good option.
Does anybody know of any 'best practice' solutions for this situation?
I usually find my answers with google, but in this instance im not even sure what im searching for.
Thanks
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
If all the events have a similar signature, Delegate.CreateDelegate (starting with .Net v2.0, it supports covariance) and EventInfo.AddEventHandler should help.
However, if you absolutely must use methods with completely different method signatures, then try this approach
|
|
|
|
|
You don't make this a "global" event. This would probably be an event exposed by a singleton data store you create. An event can have multiple subscribers, but since you're sharing data acrossed multiple instances of your control, it would suggest using a central data store to back all instances of the control.
|
|
|
|
|
thanks for your suggestion Dave, i will take a look into it
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
Agree with Dave. In your case, no need to create a "complex" global event manager. Just update the UI when you modify the data. Simplicity is always good.
I Love KongFu~
|
|
|
|
|
Hi everybody,
I want to show a property´s value description other than the original in the PropertyGrid control. For example:
I inherited from TextBox control and I want the Visible property´s value description be "Verdadeiro/Falso" instead of "True/False".
Verdadeiro means True in portuguese, and Falso means False.
Anyone know how can I do that?
Thanks.
|
|
|
|
|
well you can use xml tags to write descriptions. If you have VisualStudio or something similar, try writting '///' before the Visible funstion (which i think you will have to override) and it should give you a template. Or Look Here[^]
I think that answers your question, right?
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
No, it doesn´t answer.
But is not your fault, I forgot to mention that the value description is to appear in the PropertyGrid control.
|
|
|
|
|
Hi,
IIRC what you want is in the DescriptionAttribute class.
Luc Pattyn [Forum Guidelines] [My Articles]
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets
modified on Sunday, June 12, 2011 9:19 AM
|
|
|
|
|
Yes, this gave me a clue on how to do what I want.
Thanks
|
|
|
|
|
WPF APPLICATION NOT A WINDOWS FORM
i made a style of a button that got an image in his gridand i saved it to a ReasourceDictoinary.xmal
i use this style to create buttons in my application (i use an array of buttons)
the button content presentor gets a string from an xml file, that gives it name.
i like to give the source of an image from a string too(it should go to the image i put in the grid of the styled button)
i can put the image insted of a string in the content presentor but not both
help plz
<br />
int i=0;<br />
Button btNew = new Button();<br />
btNew[i] = new Button[5];<br />
btNew[i].Height = 132;<br />
btNew[i].Width = 132;<br />
BitmapImage bit = new BitmapImage(new Uri(@"D:\BACKGROUND-.png", UriKind.Relative));<br />
ResourceDictionary res = (ResourceDictionary)Application.LoadComponent(new Uri("Dictionary1.xaml", UriKind.Relative));<br />
Style style = (Style)res["btn2"];<br />
btNew[i].Style = style;<br />
btNew[i].Content = "string from xml";<br />
LayoutRoot.Children.Add(btNew[i]);<br />
i++;<br />
i thought about somthing like that:
<br />
btNew[i].Style.Reasource["Image"] = bit;<br />
THANKS
|
|
|
|
|
Hi Guys,
I'm experiencing the following problem with DataGridViewComboBoxCell:
When clicking the arrow that opens the combo box for the first time, everything is fine. However, when clicking it again (as long as the cell is still in focus) the list drops (opens) and closes immediately. The only way to change its value is to select another component so it loses focus, and then click it once again.
Does anyone has an idea how to solve it?
Thanks,
Eyal.
modified on Tuesday, March 10, 2009 6:19 AM
|
|
|
|
|
Hi! I would like know how can I show videos in web service using C#. I have a Sql Server database and I inserted videos like a varbinary(max)following instructions from:
http://www.codeproject.com/KB/aspnet/VideoUploaderControl.aspx , so I can insert videos in a Sql Server database, but I want show them in web service. How can I do that?
Please help me. Thanks !
|
|
|
|
|
|
Thanks for the suggestions. We tried to do that, but we can´t show videos. We have a GenericHandler:
]]>
using System;
using System.Web;
using System.Data.SqlClient;
using System.Data;
using System.Configuration;
public class VideoHandler : IHttpHandler
{
private localhost.wsDataReader ejemplo;
public void ProcessRequest (HttpContext context)
{
ejemplo = new localhost.wsDataReader();
context.Response.BinaryWrite((byte[]) ejemplo.MostrarDatos() );
}
public bool IsReusable
{
get {
return false;
}
}
}
If we only execute it shows a window for download the video: open, save or cancel.
This .ashx uses the WebMethod called MostrarDatos():
using System;
using System.Web;
using System.Web.Services;
using System.Web.Services.Protocols;
using System.Data.SqlClient;
[WebService(Namespace = "http://localhost/wsDataReader/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
public class wsDataReader : System.Web.Services.WebService
{
public SqlConnection ConexionConBD;
public SqlCommand Orden;
public SqlDataReader Lector;
[WebMethod(Description = "Este método devuelve un video utilizando DataReader")]
public byte[] MostrarDatos()
{
string Conexion ="Data Source=.\\SQLEXPRESS;AttachDbFilename=\"|DataDirectory|\\BDvideos.mdf\";Integra" +
"ted Security=True;User Instance=True";
ConexionConBD = new SqlConnection(Conexion);
string Consulta = "SELECT Video FROM Videos";
Orden = new SqlCommand(Consulta, ConexionConBD);
ConexionConBD.Open();
Lector = Orden.ExecuteReader();
Lector.Read();
return (byte[]) Lector["Video"];
}
}
We don´t want download the video. We only want show the video in a WindowsFormsApplication or in a Website (.aspx)...
What code we should use?
|
|
|
|
|
Javier Aballay wrote: but I want show them in web service.
Web Services, like all services, don't have any user interface, thus they show nothing. Perhaps you need to reword your question?
|
|
|
|
|
Hi everybody.
I'm going to work on Face Recognition with C#, I'm green on it.
So , do you know any references for algorithms or samples about it ?
I've searched Google , but I've not found anything special.
Could you post some samples about it ?
Many thanks in advance.
|
|
|
|
|
Mohammad Dayyan wrote: I'm going to work on Face Recognition with C#, I'm green on it.
Then you probably aren't aware of how increadibly difficult a problem domain this is. People have worked for years trying to get face regognition to the point is is today... And it still isn't anywhere near perfect.
Mohammad Dayyan wrote: Could you post some samples about it ?
This is an area of computer science that is still mostly in the academic sphere. You might want to try searching university libraries and academic publications.
|
|
|
|
|
Colin Angus Mackay wrote: Then you probably aren't aware of how increadibly difficult a problem domain this is.
Yeah, you're right. But we should start to aware of them.
Hope springs eternally
|
|
|
|