¡@

Home 

c# Programming Glossary: handle

Looking for C# HTML parser [duplicate]

http://stackoverflow.com/questions/100358/looking-for-c-sharp-html-parser

it was pretty effective. It wasn't foolproof but it did handle most of the malformed tags etc. that you find on the web these..

ASP.NET MVC Custom Error Handling Application_Error Global.asax?

http://stackoverflow.com/questions/1171035/asp-net-mvc-custom-error-handling-application-error-global-asax

that since you are going through the asp.net pipeline to handle a 404 you will create a session object for all those hits. This..

What NoSQL solutions are out there for .NET? [closed]

http://stackoverflow.com/questions/1777103/what-nosql-solutions-are-out-there-for-net

has developed a very fast async C# Redis Client used to handle Stack Overflows and other Stack Exchange sites distributed caching...

Embedding DLLs in a compiled executable

http://stackoverflow.com/questions/189549/embedding-dlls-in-a-compiled-executable

just leaving the DLLs outside and having the setup program handle everything but there have been a couple of people at work who..

When to Use Static Classes in C#

http://stackoverflow.com/questions/241339/when-to-use-static-classes-in-c-sharp

stateless you can still create static wrapper methods that handle everything while still giving you all the benefits in the long..

Proper way to implement IXmlSerializable?

http://stackoverflow.com/questions/279534/proper-way-to-implement-ixmlserializable

Unlike the WriteXml method the framework does not handle the wrapper element automatically. Your implementation must..

Best practices for exception management in Java or C#

http://stackoverflow.com/questions/409563/best-practices-for-exception-management-in-java-or-c-sharp

management in Java or C# I'm stuck deciding how to handle exceptions in my application. Much if my issues with exceptions.. this exception being thrown How does it make sense to handle it Does the caller really care about the exception or do they.. is more of a C mindset than a Java in Java you would just handle the exception one. Follow the error management constructs associated..

VS2010 does not show unhandled exception message in a WinForms Application on a 64-bit version of Windows

http://stackoverflow.com/questions/4933958/vs2010-does-not-show-unhandled-exception-message-in-a-winforms-application-on-a

does not show unhandled exception message in a WinForms Application on a 64 bit version.. 4 VS2010 2 add the following code to the Form1_Load handler int vara 5 varb 0 int varc vara varb int vard 7 I would expect.. int vard 7 I would expect that VS breaks and shows an unhandled exception message at the second line. However what happens..

File Upload ASP.NET MVC 3.0

http://stackoverflow.com/questions/5193842/file-upload-asp-net-mvc-3-0

submit value OK and then you would have a controller to handle the upload public class HomeController Controller This action.. form public ActionResult Index return View This action handles the form POST and the upload HttpPost public ActionResult Index..

Proper use of the IDisposable interface

http://stackoverflow.com/questions/538060/proper-use-of-the-idisposable-interface

means things like database connections sockets window handles etc. But I've seen code where the Dispose method is implemented.. bug from creeping in. When the user calls Dispose the handle gdiCursorBitmapStreamFileHandle is destroyed. Later when the.. the garbage collector runs it will try to destroy the same handle again. protected void Dispose Boolean iAmBeingCalledFromDisposeAndNotFinalize..

What is the best workaround for the WCF client `using` block issue?

http://stackoverflow.com/questions/573872/what-is-the-best-workaround-for-the-wcf-client-using-block-issue

per comments Since Use returns void the easiest way to handle return values is via a captured variable int newOrderId 0 need..

How to handle WndProc messages in WPF?

http://stackoverflow.com/questions/624367/how-to-handle-wndproc-messages-in-wpf

to handle WndProc messages in WPF Finding WPF a steep learning curve... specialised. Now I'm not quite sure why you'd want to handle Windows Messaging messages in a WPF application unless it's..

Using C#, how does one figure out what process locked a file?

http://stackoverflow.com/questions/860656/using-c-how-does-one-figure-out-what-process-locked-a-file

string UnsafeGetFilesLockedBy Process process try var handles GetHandles process var files new List string foreach var.. GetHandles process var files new List string foreach var handle in handles var file GetFilePath handle process if file null.. process var files new List string foreach var handle in handles var file GetFilePath handle process if file null files.Add..

Convert System.Drawing.Icon to System.Media.ImageSource

http://stackoverflow.com/questions/1127647/convert-system-drawing-icon-to-system-media-imagesource

an unmanaged managed boundary that corresponds to an Icon Handle. Converting it to an Icon is trivial via the FromHandle method.. Handle. Converting it to an Icon is trivial via the FromHandle method and this was satisfactory until recently. Basically I've..

Google Weather API 403 Error

http://stackoverflow.com/questions/11878143/google-weather-api-403-error

Google article illustrating API error handling Google API Handle Errors Thanks to http stackoverflow.com a 12011819 1302173 Catch..

Avoiding the woes of Invoke/BeginInvoke in cross-thread WinForm event handling?

http://stackoverflow.com/questions/1364116/avoiding-the-woes-of-invoke-begininvoke-in-cross-thread-winform-event-handling

be used with any event type assume a delegate of type EventHandler Must not translate exceptions to TargetInvocationException... to return false if running on current thread or if IsHandleCreated returns false for all parents. I'm troubled by the InvokeRequired.. we can trust InvokeRequired returning false is when IsHandleCreated returns true both before and after the call BTW the MSDN..

Design pattern for handling multiple message types

http://stackoverflow.com/questions/1477471/design-pattern-for-handling-multiple-message-types

chain of responsibility pattern public interface IMessageHandler bool HandleMessage IMessage msg public class OrderMessageHandler.. pattern public interface IMessageHandler bool HandleMessage IMessage msg public class OrderMessageHandler bool HandleMessage.. bool HandleMessage IMessage msg public class OrderMessageHandler bool HandleMessage IMessage msg if msg is OrderMessage return..

C# - Make a borderless form movable?

http://stackoverflow.com/questions/1592876/c-sharp-make-a-borderless-form-movable

if e.Button MouseButtons.Left ReleaseCapture SendMessage Handle WM_NCLBUTTONDOWN HT_CAPTION 0 This essentially does exactly..

How do I serve up an Unauthorized page when a user is not in the Authorized Roles?

http://stackoverflow.com/questions/2322366/how-do-i-serve-up-an-unauthorized-page-when-a-user-is-not-in-the-authorized-role

I get an error page resource not found . So I put the HandleError attribute in also. Authorize Roles Admin User HandleError.. HandleError attribute in also. Authorize Roles Admin User HandleError Public ActionResult Index int id blah Now it goes to the.. . Derive from AuthorizeAttribute and override HandleUnauthorizedRequest. In this method if the user is authenticated..

How do I find out which process is locking a file using .NET?

http://stackoverflow.com/questions/317071/how-do-i-find-out-which-process-is-locking-a-file-using-net

file using .NET I've seen several of answers about using Handle or Process Monitor but I would like to be able to find out in..

Does the C# “finally” block ALWAYS execute? [duplicate]

http://stackoverflow.com/questions/3216046/does-the-c-sharp-finally-block-always-execute

default message You will not win return catch Exception Handle an exception. finally MessageBox.Show message Ha after I got..

GetMethod for generic method [duplicate]

http://stackoverflow.com/questions/4035719/getmethod-for-generic-method

if type.IsByRef type type.GetElementType Handle array types if thisType.IsArray type.IsArray return thisType.GetElementType.. T type.IsGenericParameter type typeof T return true Handle any generic arguments if thisType.IsGenericType type.IsGenericType..

try/catch + using, right syntax

http://stackoverflow.com/questions/4590490/try-catch-using-right-syntax

new MyClass try something here... catch Exception ex Handle exception OR try using var myObject new MyClass something here..... myObject new MyClass something here... catch Exception ex Handle exception c# try catch using statement share improve this..

How do I make a textbox that only accepts numbers?

http://stackoverflow.com/questions/463299/how-do-i-make-a-textbox-that-only-accepts-numbers

the keyboard to increment and decrement the current value. Handle the appropriate keyboard events to prevent anything but numeric.. e.KeyChar char.IsDigit e.KeyChar e.KeyChar '.' e.Handled true only allow one decimal point if e.KeyChar '.' sender.. if e.KeyChar '.' sender as TextBox .Text.IndexOf '.' 1 e.Handled true You can remove the check for '.' and the subsequent check..

in a “using” block is a SqlConnection closed on return or exception?

http://stackoverflow.com/questions/4717789/in-a-using-block-is-a-sqlconnection-closed-on-return-or-exception

5 command.ExecuteNonQuery catch Exception Handle error Now say somewhere in the try we get an error and it gets..

Clipboard event C#

http://stackoverflow.com/questions/621577/clipboard-event-c-sharp

viewer using _ClipboardViewerNext SetClipboardViewer this.Handle and then you will recieve the WM_DRAWCLIPBOARD message which.. switch Win32.Msgs m.Msg case Win32.Msgs.WM_DRAWCLIPBOARD Handle clipboard changed break ... There's more to be done passing..

minimize app to system tray

http://stackoverflow.com/questions/7625421/minimize-app-to-system-tray

To Tray With NotifyIcon Minimize window to system tray Handle the form ™s Resize event. In this handler you override the basic..

How to use HTML Agility pack

http://stackoverflow.com/questions/846994/how-to-use-html-agility-pack

if htmlDoc.ParseErrors null htmlDoc.ParseErrors.Count 0 Handle any parse errors as required else if htmlDoc.DocumentNode null..

Notify ObservableCollection when Item changes

http://stackoverflow.com/questions/8490533/notify-observablecollection-when-item-changes

base CollectionChanged new NotifyCollectionChangedEventHandler TrulyObservableCollection_CollectionChanged void TrulyObservableCollection_CollectionChanged.. .PropertyChanged new PropertyChangedEventHandler item_PropertyChanged if e.OldItems null foreach Object item.. .PropertyChanged new PropertyChangedEventHandler item_PropertyChanged void item_PropertyChanged object sender..

Using C#, how does one figure out what process locked a file?

http://stackoverflow.com/questions/860656/using-c-how-does-one-figure-out-what-process-locked-a-file

Process process try var handles GetHandles process var files new List string foreach var handle in handles.. GetFilePath Win32API.SYSTEM_HANDLE_INFORMATION systemHandleInformation Process process var ipProcessHwnd Win32API.OpenProcess.. var strObjectName var nLength 0 IntPtr ipTemp ipHandle if Win32API.DuplicateHandle ipProcessHwnd systemHandleInformation.Handle..

Observable Collection Property Changed on Item in the Collection

http://stackoverflow.com/questions/1015126/observable-collection-property-changed-on-item-in-the-collection

_SomeItem_PropertyChanged break .... HANDLE OTHER CASES HERE .... For #2 in your CollectionChanged handler..

.NET : How to set user information in an EventLog Entry?

http://stackoverflow.com/questions/147307/net-how-to-set-user-information-in-an-eventlog-entry

Platform Invoke Data Types says So BOOL ReportEvent __in HANDLE hEventLog __in WORD wType __in WORD wCategory __in DWORD dwEventID..

Physical disk size not correct (IoCtlDiskGetDriveGeometry)

http://stackoverflow.com/questions/15051660/physical-disk-size-not-correct-ioctldiskgetdrivegeometry

IntPtr using LPOVERLAPPED IntPtr using LPVOID IntPtr using HANDLE IntPtr using LARGE_INTEGER Int64 using DWORD UInt32 using LPCTSTR.. DWORD dwCreationDisposition DWORD dwFlagsAndAttributes HANDLE hTemplateFile DllImport kernel32.dll SetLastError true static.. OPEN_EXISTING DWORD dwFlagsAndAttributes 0 HANDLE hTemplateFile default IntPtr using var hDevice CreateFile..

Possible to launch a process in a user's session from a service?

http://stackoverflow.com/questions/3128017/possible-to-launch-a-process-in-a-users-session-from-a-service

if you knows the users token hClient . BOOL bSuccess HANDLE hProcessToken NULL hNewProcessToken NULL DWORD dwSessionId cbReturnLength..

Using Process.Start() to start a process as a different user from within a Windows Service

http://stackoverflow.com/questions/362419/using-process-start-to-start-a-process-as-a-different-user-from-within-a-windo

WORD wShowWindow WORD cbReserved2 LPBYTE lpReserved2 HANDLE hStdInput HANDLE hStdOutput HANDLE hStdError STARTUPINFO LPSTARTUPINFO.. WORD cbReserved2 LPBYTE lpReserved2 HANDLE hStdInput HANDLE hStdOutput HANDLE hStdError STARTUPINFO LPSTARTUPINFO #endregion.. LPBYTE lpReserved2 HANDLE hStdInput HANDLE hStdOutput HANDLE hStdError STARTUPINFO LPSTARTUPINFO #endregion struct STARTUPINFO..

NTFS Alternate Data Streams - .NET

http://stackoverflow.com/questions/604960/ntfs-alternate-data-streams-net

kb 105763 #include windows.h #include stdio.h void main HANDLE hFile hStream DWORD dwRet hFile CreateFile testfile GENERIC_WRITE.. NULL OPEN_ALWAYS 0 NULL if hFile INVALID_HANDLE_VALUE printf Cannot open testfile n else WriteFile hFile This.. NULL OPEN_ALWAYS 0 NULL if hStream INVALID_HANDLE_VALUE printf Cannot open testfile stream n else WriteFile hStream..

How can I prevent BufferManager / PooledBufferManager in my WCF client app from wasting memory?

http://stackoverflow.com/questions/7252417/how-can-i-prevent-buffermanager-pooledbuffermanager-in-my-wcf-client-app-from

etc. 0 000 x86 gcroot nostacks 193e1000 DOMAIN 00B8CCD0 HANDLE Pinned 4d1330 Root 0e5b9c50 System.Object 035064f0 MyServiceManager..

Can't find PInvoke DLL - BUG?

http://stackoverflow.com/questions/9410197/cant-find-pinvoke-dll-bug

#ifdef _DEBUG #define new DEBUG_NEW #endif void CaptureGPS HANDLE hDrv CreateFile TEXT FNC1 GENERIC_READ GENERIC_WRITE 0 NULL..