Format:
Recent snippets matching tags of windows
public class HandleTheme { // light public static string GetLightUrl(DependencyObject obj) { return (string)obj.GetValue(LightUrlProperty); } public static void SetLightUrl(DependencyObject obj, string value) { obj.SetValue(LightUrlProperty, value);
81 Views
no comments
public partial class MyDataContext : System.Data.Linq.DataContext { public void OnCreated() { if (!this.DatabaseExists()) MoveDatabase("MyDatabase.sdf"); } public static void MoveDatabase(string name) {
101 Views
no comments
void DoQuery() { // Register for the LoadCompleted event. var _Data = new DataServiceCollection<CityCrime>(); _Data.LoadCompleted += _Data_LoadCompleted; // start the servery query var _Query = GetContext().CityCrime .Where(x => x.State == "Colorado") .Where(x => x.City == "Denver");
71 Views
no comments
// https://datamarket.azure.com/ private const string AZUREDATAACCOUNT = "Your Customer ID"; private const string AZUREDATAKEY = "Your Account Key"; private const string AZUREDATAURL = "https://api.datamarket.azure.com/Data.ashx/data.gov/Crimes/"; // create a new context to the odata feed private static Mango.Sample.AzureMarket .CityCrimeService.datagovCrimesContainer GetContext() {
57 Views
no comments
public void SaveData(string path, object data) { var _Store = IsolatedStorageFile.GetUserStoreForApplication(); using (var _Stream = new IsolatedStorageFileStream(path, FileMode.Create, _Store)) { var _Serializer = new XmlSerializer(data.GetType()); _Serializer.Serialize(_Stream, data); } }
102 Views
no comments
var _Key = "MyUniqueKey"; // persist data to the dictionary var _DataToStore = "Store this string!"; IsolatedStorageSettings .ApplicationSettings.Add(_Key, _DataToStore); // test presence in store var _BoolResult = IsolatedStorageSettings .ApplicationSettings.Contains(_Key);
70 Views
no comments
const string KEY = "MyUniqueKey"; private void SaveButton_Click(object sender, EventArgs e) { var _Store = IsolatedStorageFile.GetUserStoreForApplication(); using (var _Stream = new IsolatedStorageFileStream(KEY, FileMode.Create, _Store)) { var _Data = MyTextBox.Text; var _Serializer = new XmlSerializer(typeof(string));
37 Views
no comments
'***********************************************************************************************************************-- '***********************************************************************************************************************-- 'This is a Visual Basic Script that hits a WebURL 'The WebURL hit is the one provided as the parameter (in this case through the windows task scheduler) 'Instructions: Set this .vbs as the action for a schedule task and in the parameters section pass in the WebUrl u wish to hit '***********************************************************************************************************************-- '***********************************************************************************************************************-- 'Create variable to hold passing in arguments args = WScript.Arguments.Count
33 Views
no comments
/* GNOT General Public License! (c) 1995-2011 Microsoft Corporation */ #include "dos.h" #include "win95.h" #include "win98.h" #include "sco_unix.h" #include "metro.h" //windows 8
135 Views
no comments
// // Besides some IoC container hookup and the plumbing for // EventAggregator and Azure ServiceBus this is what an // Event Driven Architecture application suited for // Continuous Client may look like. // // This was not done in an MVVM pattern as it would just // introduce complexity for people unfamiliar. I wanted to // focus on the Event Driven Architecture. //
801 Views
no comments
using System; using System.Collections; using System.Collections.Generic; namespace Core { /// <summary> /// Validation Routines /// </summary> /// <remarks>
444 Views
no comments
class Program { static void Main() { if (Environment.UserInteractive) { ServiceManager serviceManager = new ServiceManager(); serviceManager.OpenAll(); Console.ReadKey(); serviceManager.CloseAll(); } else ServiceBase.Run(new WindowsService());
288 Views
no comments
foreach ($adminGroup in gwmi -computer "." Win32_Group | where {$_.SID -eq "S-1-5-32-544"} | select -Property __PATH) {foreach ($userPart in gwmi Win32_GroupUser | where {$_.GroupComponent -eq $adminGroup.__PATH} | select PartComponent) {gwmi Win32_Account | where {$_.__PATH -eq $userPart.PartComponent} | select @{Name="Account";Expression={$_.Caption}}}}
273 Views
no comments
C:\Users\administrator.OSM>dism /online /enable-feature /featurename:IIS-WebServ erRole Deployment Image Servicing and Management tool Version: 6.1.7600.16385 Image Version: 6.1.7600.16385 Enabling feature(s)
467 Views
no comments
param ([string]$computerName = (gc env:computername)) function GetExceptionType($type, $logEvent) { if ($type -ne "Error") { $logEvent.ReplacementStrings[17] } else { $rx = [regex]"Exception:.([0-9a-zA-Z].+)" $matches = $rx.match($logEvent.ReplacementStrings[0]) $matches.Groups[1].Value }
612 Views
no comments
Subscribe
Discuss
What's new
What is it
New Snippet
Recent Snippets
My Snippets
Web Code
Search
