I have an LDAP query, which I am using to perform a search in C#. It uses two string variables (username and domain) which need to be escaped for security reasons.
How should I escape the strings? Is there a function available in C#.NET to do this?
Example LDAP search conditions :
(objectCategory=person)
(userprincipalname=username@...
I'm trying to debug an error coming out of a Windows .NET based application. The error message goes something like "Error creating window handle". On researching about this error I found out that the likely cause is that the application is using more than 10000 user handles.
I want to put in some debug code into the application and see...
I have a C# application that I want to use Flickr's API. I received my API key and shared secret, but when receiving the key it explicitly mentions not giving out the API key we were provided.
Since the app is open source and also easily viewed with Reflector, I don't think storing it as a string is really secure.
I could encrypt it...
I found the CompilationRelaxations attribute on an assembly when looking at it in Reflector. This link says that the attribute specifies whether:
Optimizers are granted additional latitude for relaxed exceptions.
What are relaxed exceptions and what does the compiler do given its "additional latitude" with them.
...
how could i have the web server execute a certain method on the 1st of each month at 10am? and if the server is down at that time, what could be a way to ensure that the method executes when the server returns..
any thoughts would be appreciated..
EDIT: yeah, windows server
...
hi there,
when developing wpf applications i never use the graphical editor ( aka cider). only the xaml editor. as "cider" needs quite some resources when loaded i wonder if there is a way to completely disable it. This may speed up loading xaml files.
i heard that this is possible, but as google does not return what i`m looking for, i...
Is there a way to call MessageBox.Show that appears in the taskbar?
It would probably be best to just create a custom form and display it of course, but being a lazy programmer I want to avoid redoing the default Error and Alert notification icons you get with a good old fashioned MessageBox.Show call.
...
I'm using MSYS to get some semblance of a sane scriptable shell on Windows :).
Now I'm writing a console application, written in C#, that accepts a number of arguments and presents those as options to the user in a dialog box. The actual options correspond to file names, that I'm retrieving with ls.
However, trouble appears when I have...
I am creating a Windows Application in c# which can print a .html file every after 15 mins and it's working good.
Now when the system is going in sleep mode the application also sleeps. So i am creating a new Windows Service for the same job.
The service also working good but when the print event fires, a print dialog box appears on ...
I want to use the updateModel in a controller that has no notice of the type of the view.
I have different views that have different types but all have an ExternalBase class as inherited type.
So in my controller I always have a ExternalBase but the controller doesn't know the correct type.
On saving I call a method that gets the co...
Can anyone provide an example of .NET scripting?
Some dynamic languages support functions like eval() or compile() than let you compile and execute a string in run-time.
VBCodeProvider seems to be a related namespace, but i can't find an example showing how to compile and execute code.
Edit:
I'm developing a ASP.NET site using VB.N...
I'm writing a cell and row class that will allow users to host controls inside DataGridViewCells and DataGridViewRows. I'm doing it by adding the control to the DataGridView's control collection and showing or hiding it at the appropriate position onscreen to overlay the cell or row. I need to find out when the cell or row's bounds or ...
I've got a windows service which scans a folder every n seconds for changes. I'm getting "the service did not respond to the start command in a timely fashion" when trying to start it up.
I've got a loop setting off in OnStart like so:
public void OnStart(string[] args)
{
while (!_shouldExit)
{
//Do Stuff
//...
I like to use 'this' statement for all non-local variables: for properties, for class variables, etc. I do this for code easy reading, easy understanding where from this variable has got.
object someVar;
object SomeProperty { get; set }
void SomeMethod(object arg1, object arg2)
{
this.SomeProperty = arg1;
this.someVar = arg2;
}
...
I'm using the CellToolTipTextNeeded event of a DataGridView, and the tooltip is being shown under the mouse. I can get the ToolTip object out via reflection, but I don't have any control over where it's positioned since I'm not the one calling Show(). How do I move a tooltip?
...
I am trying to implement a "underline\fix while you type spell checker" can anyone point me to some examples.
...
Is there a way to call method inside a running .NET assembly.
The problem is that I have a .NET application that is run on system startup and puts itself in the system tray. The user can open the application dialog by double-clicking on the tray icon but I want to show the form even when the user start the application again (and its alr...
I would like to flush a user's session with my website as soon as they close their web browser. How do I go about implementing that?
...
I have a DrawingArea which I would like to received mouse events.
From the tutorials I have found that the KeyPressEvent will also catch mouse events.
However for the following code the handler is never called.
static void Main ()
{
Application.Init ();
Gtk.Window w = new Gtk.Window ("");
DrawingArea a = new CairoGraphic ()...
I am binding an array to a DataGridView. I have a column containing file paths which maps to a column of push buttons. I would like to pre-process the file path so that the DataGridViewButtonColumn displays only the file name (sans the parent folders).
How do I intercept and pre-process values before they are bound to the columns of a D...