¡@

Home 

c# Programming Glossary: win

How to shutdown the computer from C#

http://stackoverflow.com/questions/102567/how-to-shutdown-the-computer-from-c-sharp

for something that's simpler and natively .net. c# .net windows shutdown share improve this question Works starting with.. share improve this question Works starting with windows XP not available in win 2000 or lower This is the quickest.. question Works starting with windows XP not available in win 2000 or lower This is the quickest way to do it Process.Start..

Send a file via HTTP POST with C#

http://stackoverflow.com/questions/1131425/send-a-file-via-http-post-with-c-sharp

fine anything really useful. I'm writing an small C# win app that allows user to send files to a web server not by FTP.. using POST. Think of it like a web form but running on a windows application. I have my HttpWebRequest object created using..

Hide a C# program from the task manager?

http://stackoverflow.com/questions/1212318/hide-a-c-sharp-program-from-the-task-manager

I didn't intend to do something spooky. Just wanted to win a bet with my friend that I can do it without him noticing...

How to join int[] to a character separated string in .NET?

http://stackoverflow.com/questions/145856/how-to-join-int-to-a-character-separated-string-in-net

Compare two DataTables to determine rows in one but not the other

http://stackoverflow.com/questions/164144/compare-two-datatables-to-determine-rows-in-one-but-not-the-other

like a quicksort . If they're already sorted then you win big. Step through both tables at once skipping over any gaps..

Is the C# compiler smart enough to optimize this code?

http://stackoverflow.com/questions/2162541/is-the-c-sharp-compiler-smart-enough-to-optimize-this-code

in this question. In terms of performance should the following code be written like this int maxResults criteria.MaxResults.. perhaps optimizing those operations instead would be a net win. and so on. It get real complicated real fast. In short you..

Why .NET String is immutable? [duplicate]

http://stackoverflow.com/questions/2365272/why-net-string-is-immutable

up to save a massive amount of memory was a performance win in the case in question . With mutable objects that can't be..

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

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

fire if I return a value in a Try block Consider the following code C# code. Does the finally block execute public void DoesThisExecute.. Do not try to break me break default message You will not win return catch Exception Handle an exception. finally MessageBox.Show..

How to check if file exists on FTP before FtpWebRequest

http://stackoverflow.com/questions/347897/how-to-check-if-file-exists-on-ftp-before-ftpwebrequest

code like this however in this instance I believe it's a win for pragmatism. Calling list on the directory has the potential.. and Microsoft response here . I'd recommend using the following WebRequestMethod instead this works for me on all servers I..

Why can't the C# constructor infer type?

http://stackoverflow.com/questions/3570167/why-cant-the-c-sharp-constructor-infer-type

compatibility a ctor on a non generic type must always win. Is there a practical reason why the constructor can't support.. implemented. Not only does the feature have to be a net win it has to be a large net win compared to all the other possible.. the feature have to be a net win it has to be a large net win compared to all the other possible features we could be investing..

Good or bad practice for Dialogs in wpf with MVVM?

http://stackoverflow.com/questions/3801681/good-or-bad-practice-for-dialogs-in-wpf-with-mvvm

first approach with mvvm ViewModel which calls a dialog window var result this.uiDialogService.ShowDialog Dialogwindow title.. window var result this.uiDialogService.ShowDialog Dialogwindow title goes here dialogwindowVM ... do anything with the dialog.. Dialogwindow title goes here dialogwindowVM ... do anything with the dialog result... How does it work..

How can I add my attributes to Code-Generated Linq2Sql classes properties?

http://stackoverflow.com/questions/393687/how-can-i-add-my-attributes-to-code-generated-linq2sql-classes-properties

to edit the attributes at run time the example here is win forms but it should be pretty simple to swap it into WPF to..

Join and Include in Entity Framework

http://stackoverflow.com/questions/416847/join-and-include-in-entity-framework

and Include in Entity Framework I have the following query of linq to entities. The problem is that it doesn't seem.. between the query and Include the query will always win. To return all tags from any item with at least one tag text..

Is C# really slower than say C++?

http://stackoverflow.com/questions/5326269/is-c-sharp-really-slower-than-say-c

bit like teenagers deciding to race their cars and whoever wins gets to keep both cars. The web sites differ in one crucial.. to drive both cars. By some strange chance his car always wins and everybody else has to settle for trust me I was really.. I could flip a coin and roll a pair of dice to pick a winner and percentage by which it would win and write a seemingly..

If strings are immutable in .NET, then why does Substring take O(n) time?

http://stackoverflow.com/questions/6742923/if-strings-are-immutable-in-net-then-why-does-substring-take-on-time

that encourages reuse of most of the memory is also not a win all you've done is made your garbage collector get slower because..

Algorithm to find which numbers from a list of size n sum to another number

http://stackoverflow.com/questions/83547/algorithm-to-find-which-numbers-from-a-list-of-size-n-sum-to-another-number

for a solution in C# .Net 2.0 but may the best algorithm win irrespective. Your method signature might look something like.. traditional bin packing knapsack problem. I have been following the development of stack overflow with interest and wondered..

Pinvoke SetFocus to a particular control

http://stackoverflow.com/questions/9503027/pinvoke-setfocus-to-a-particular-control

application's textbox using it's ClassName . I have the window as an intptr etc etc but just need some guidance as to what.. for this Issue is I use the SetForegroundWindow API to get window focus but it wouldn't let me send the Ctrl L keys to focus.. string childClassName hwndTarget is the other app's main window ... IntPtr targetThreadID WindowsAPI.GetWindowThreadProcessId..

Folder browser dialog like open file dialog

http://stackoverflow.com/questions/10990612/folder-browser-dialog-like-open-file-dialog

what you need http www.lyquidity.com devblog p 136 .NET Win 7 style folder select dialog . 'Program.cs' contains the example..

Hide Start Orb on Vista / Win 7 in C#

http://stackoverflow.com/questions/1165879/hide-start-orb-on-vista-win-7-in-c-sharp

Start Orb on Vista Win 7 in C# When hiding the Task Bar on Vista and Windows 7 the.. Vista Win 7 in C# When hiding the Task Bar on Vista and Windows 7 the Start Button also known as the Start Orb doesn't get.. hiding the Orb is as follows. First do the necessary Win32 imports and declarations. DllImport user32.dll private static..

Embed PowerPoint Viewer in C# Win Form

http://stackoverflow.com/questions/1259369/embed-powerpoint-viewer-in-c-sharp-win-form

PowerPoint Viewer in C# Win Form Is it possible to Embed a PowerPoint Viewer into a C#.. Is it possible to Embed a PowerPoint Viewer into a C# Windows Form I am currently use the following code objApp new PowerPoint.Application.. objSSS.LoopUntilStopped MsoTriState.msoTrue objSSS.Run WindowWrapper handleWrapper new WindowWrapper objPres.SlideShowWindow.HWND..

System.Timers.Timer only gives max 64 frames per second

http://stackoverflow.com/questions/13521521/system-timers-timer-only-gives-max-64-frames-per-second

object to raise events that are processed by the main form WinForms C# . My problem is that no matter how short I set the .Interval.. than other timer services. You will need following Win API functions to set timer resolution start and stop timer DllImport..

C# How to programatically change the playback device

http://stackoverflow.com/questions/1555156/c-sharp-how-to-programatically-change-the-playback-device

default audio device on a vista win 7 system Using C# or a Win API call c# windows 7 audio playback share improve this question.. 7 audio playback share improve this question The WinMM API should provide the functionality that you request. You.. the waveform sound out yourself you should look at the WinMM.Net library. http winmm.codeplex.com share improve this answer..

Program Compatibility Assistant thinks my app is an installer

http://stackoverflow.com/questions/1577412/program-compatibility-assistant-thinks-my-app-is-an-installer

thinks my app is an installer I have created a .NET C# WinForms application on Win 7 RTM x64 which let's say I have called.. I have created a .NET C# WinForms application on Win 7 RTM x64 which let's say I have called DataInstaller. When.. application The ID below indicates application support for Windows Vista supportedOS Id e2011457 1546 43c5 a5fe 008deee3d3f0..

WPF WebBrowser Control - position:fixed Element jumps while scrolling (Windows 8)

http://stackoverflow.com/questions/17209626/wpf-webbrowser-control-positionfixed-element-jumps-while-scrolling-windows-8

Control position fixed Element jumps while scrolling Windows 8 We use the WPF WebBrowser control to display an embedded.. the WPF WebBrowser control to display an embedded page. On Windows 8 we observe a strange jumping behavior of elements with.. fixed while scrolling. The same page works fine in IE10 on Windows 8 also FF Chrome and in the WPF WebBrowser control on Windows..

Set global hotkeys using C#

http://stackoverflow.com/questions/2450373/set-global-hotkeys-using-c-sharp

class KeyboardHook IDisposable Registers a hot key with Windows. DllImport user32.dll private static extern bool RegisterHotKey.. id uint fsModifiers uint vk Unregisters the hot key with Windows. DllImport user32.dll private static extern bool UnregisterHotKey.. used internally to get the messages. summary private class Window NativeWindow IDisposable private static int WM_HOTKEY 0x0312..

Get Master Sound Volume in c#

http://stackoverflow.com/questions/2534595/get-master-sound-volume-in-c-sharp

IAudioMeterInformation in the CoreAudio APIs in Vista and Win 7. Managed wrappers are available in NAudio get at the AudioMeterInformation..

Detect Windows 7 in .net

http://stackoverflow.com/questions/2819934/detect-windows-7-in-net

Windows 7 in .net How can I detect Windows 7 versions in .net What.. Windows 7 in .net How can I detect Windows 7 versions in .net What code can I use c# .net windows.. has the information you need for distinguishing most Windows OS major releases but not all. It consists of three components..

Activation error occured while trying to get instance of type LogWriter

http://stackoverflow.com/questions/2900403/activation-error-occured-while-trying-to-get-instance-of-type-logwriter

of Enterprise Library 5.0 to log simple message to the Windows event log on Win XP SP3 system using Logger.Write msg I.. 5.0 to log simple message to the Windows event log on Win XP SP3 system using Logger.Write msg I get the Activation error.. newline #xA Thread Name threadName newline #xA Win32 ThreadId win32ThreadId newline #xA Extended Properties dictionary..

How to detect Windows 64-bit platform with .NET?

http://stackoverflow.com/questions/336633/how-to-detect-windows-64-bit-platform-with-net

to detect Windows 64 bit platform with .NET In a .NET 2.0 C# application.. This returns Win32NT . The problem is that it returns Win32NT even when running.. This returns Win32NT . The problem is that it returns Win32NT even when running on Windows Vista 64 bit. Is there any..

How can I programmatically access the Google Chrome Home or Start page?

http://stackoverflow.com/questions/4008194/how-can-i-programmatically-access-the-google-chrome-home-or-start-page

share improve this question Default locations are Windows XP Google Chrome C Documents and Settings username Local.. the data that I am interested and print it out. Win 7 Example using System using System.Collections.Generic using.. static void Main string args const int LikeWin7 6 OperatingSystem osInfo Environment.OSVersion DirectoryInfo..

Start a windows service and launch cmd

http://stackoverflow.com/questions/4147821/start-a-windows-service-and-launch-cmd

p new Process p.StartInfo new ProcessStartInfo @ C Windows system32 cmd.exe p.Start p.WaitForExit base.Stop protected.. process from a service without calling a number of Win API. BLACK MAGIC Have a look here and here . The code below.. dwFillAttribute public Int32 dwFlags public Int16 wShowWindow public Int16 cbReserved2 public IntPtr lpReserved2 public..

System Tray only (no dock icon) application using C# / Mono on Mac

http://stackoverflow.com/questions/4414629/system-tray-only-no-dock-icon-application-using-c-sharp-mono-on-mac

to add a Status bar icon alternative of Notify Icon in Win Forms NSStatusItem sItem NSStatusBar.SystemStatusBar.CreateStatusItem..

Log off user from Win XP programmatically in C#

http://stackoverflow.com/questions/484278/log-off-user-from-win-xp-programmatically-in-c-sharp

off user from Win XP programmatically in C# How do I initiate a Windows XP user.. from Win XP programmatically in C# How do I initiate a Windows XP user Log Off from a C# app The action of my app should.. share improve this question You could P Invoke ExitWindowsEx http www.pinvoke.net default.aspx user32 ExitWindowsEx.html..

Pinvoke SetFocus to a particular control

http://stackoverflow.com/questions/9503027/pinvoke-setfocus-to-a-particular-control

are available for this Issue is I use the SetForegroundWindow API to get window focus but it wouldn't let me send the Ctrl.. make that work and that worked well on my apps and newer Windows etc. void SetFocus IntPtr hwndTarget string childClassName.. is the other app's main window ... IntPtr targetThreadID WindowsAPI.GetWindowThreadProcessId hwndTarget IntPtr.Zero target..

Monitor when an exe is launched

http://stackoverflow.com/questions/967646/monitor-when-an-exe-is-launched

would like to enable the option to only start the external Windows services to initialize after the application is launched... implement this so ideally I would like to write a C# .Net Windows service that would monitor when an exe is launched. What.. The solution would be required to run on XP Vista and Win 7 when it comes... Thanks in advance for any pointers. c# .net..