WPF自定义窗口(Windows Server 2012 Style)
先上图

新建CustomControl,名:HeaderedWindow
Themes\Generic.aml文件夹下加入
笔刷,转换器
<SolidColorBrush x:Key="ActiveBackground" Color="#FF66CBEA"/>
<SolidColorBrush x:Key="DeactiveBackground" Color="#FFC2D6DC"/>
<loc:BoolToVisibilityConverter x:Key="BoolToVisibilityConverter"/>
最大化,最小化,关闭按钮
<Style x:Key="styleWindowButtonMinimize" TargetType="{x:Type Button}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Button}">
<Grid x:Name="buttonClose">
<Border x:Name="btnEllipse" BorderThickness="1,0,1,1" BorderBrush="Black" Background="{TemplateBinding Background}"/>
<Path x:Name="iconMin" SnapsToDevicePixels="False" Height="21" Width="28" StrokeThickness="3" Stroke="Black" Fill="#FFFFFFFF" Data="M 8,13.5 L 19 13.5"/>
<ContentPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" RecognizesAccessKey="True"/>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsFocused" Value="True"/>
<Trigger Property="IsDefaulted" Value="True"/>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="LightGreen" TargetName="btnEllipse"/>
</Trigger>
<Trigger Property="IsPressed" Value="True"/>
<Trigger Property="IsEnabled" Value="False"/>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="styleWindowButtonMaximize" TargetType="{x:Type ToggleButton}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ToggleButton}">
<Grid>
<Border x:Name="btnEllipse" Background="{TemplateBinding Background}" Width="25" Height="21" BorderBrush="Black" BorderThickness="0,0,0,1"/>
<Path x:Name="iconMax" SnapsToDevicePixels="False" Stroke="Black" StrokeThickness="2" Data="F1 M 9 7 H 18 V 14 H 9 V 7 H 18"/>
<Path x:Name="iconRestore" SnapsToDevicePixels="False" Visibility="Collapsed" Stroke="Black" StrokeThickness="1" Data="F1 M 10.5 5.5 H 17.5 V 12.5 M 8.5 7.5 H 15.5 V 14.5 H 8.5 V 7.5 H 9.5 V 13.5 H 14.5 V 8.5 H 8.5"/>
<ContentPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" RecognizesAccessKey="True"/>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsFocused" Value="True"/>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="LightGreen" TargetName="btnEllipse"/>
</Trigger>
<Trigger Property="IsPressed" Value="True"/>
<Trigger Property="IsEnabled" Value="False"/>
<Trigger Property="IsChecked" Value="True">
<Setter TargetName="iconMax" Property="Visibility" Value="Collapsed" />
<Setter TargetName="iconRestore" Property="Visibility" Value="Visible" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="styleMainWindowButtonClose" TargetType="{x:Type Button}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Button}">
<Grid x:Name="buttonClose" Width="47" Height="21">
<Border x:Name="btnEllipse" BorderBrush="Black" BorderThickness="1,0,1,1" Background="{TemplateBinding Background}"/>
<Path x:Name="iconX" ClipToBounds="True" Stroke="Black" StrokeThickness="1" Data="F1 M 20 7 L 26 15 M 21 7 L 27 15 M 22 7 L 28 15 M 20 15 L 26 7 M 21 15 L 27 7 M 22 15 L 28 7"/>
<ContentPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" RecognizesAccessKey="True"/>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsFocused" Value="True"/>
<Trigger Property="IsDefaulted" Value="True"/>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="#FFEC6C60" TargetName="btnEllipse"/>
</Trigger>
<Trigger Property="IsPressed" Value="True"/>
<Trigger Property="IsEnabled" Value="False"/>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
窗口样式
<Style TargetType="{x:Type loc:HeaderedWindow}">
<Setter Property="WindowStyle" Value="None"/>
<Setter Property="ResizeMode" Value="NoResize"/>
<Setter Property="Background" Value="#FF66CBEA"/>
<Setter Property="BorderBrush" Value="Black"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="MinWidth" Value="90"/>
<Setter Property="MinHeight" Value="30"/>
<Setter Property="VerticalContentAlignment" Value="Stretch"/>
<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type loc:HeaderedWindow}">
<Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
<Grid SnapsToDevicePixels="True" Background="{TemplateBinding Background}">
<Grid.RowDefinitions>
<RowDefinition x:Name="HeaderRow" Height="30" />
<RowDefinition />
</Grid.RowDefinitions>
<!-- Window header-->
<Grid Name="PART_HeaderContainer" Background="Transparent">
<StackPanel Orientation="Horizontal" Margin="4,0" Visibility="{Binding RelativeSource={ x:Static RelativeSource.TemplatedParent}, Path=ShowDefaultHeader, Converter={ StaticResource BoolToVisibilityConverter }}">
<Image Height="24" Width="24" HorizontalAlignment="Left" VerticalAlignment="Center" Source="{TemplateBinding Icon}"/>
<TextBlock Text="{TemplateBinding Title}" Margin="4,0" VerticalAlignment="Center" FontFamily="Arial" FontSize="15" Foreground="#FFFFFFFF" TextWrapping="NoWrap"/>
</StackPanel>
<StackPanel HorizontalAlignment="Right" VerticalAlignment="Top" Orientation="Horizontal" Margin="0,0,5,0">
<Button x:Name="PART_MinimizeButton" IsTabStop="False" Style="{StaticResource styleWindowButtonMinimize}" Width="28" Height="21" ToolTip="Minimize" Visibility="{Binding RelativeSource={ x:Static RelativeSource.TemplatedParent}, Path=CanResize, Converter={ StaticResource BoolToVisibilityConverter }}"/>
<ToggleButton x:Name="PART_RestoreButton" IsTabStop="False" Style="{StaticResource styleWindowButtonMaximize}" Width="25" Height="21" ToolTip="Maximize" Visibility="{Binding RelativeSource={ x:Static RelativeSource.TemplatedParent}, Path=CanResize, Converter={ StaticResource BoolToVisibilityConverter }}"/>
<Button x:Name="PART_CloseButton" IsTabStop="False" Style="{StaticResource styleMainWindowButtonClose}" Width="47" Height="21" ToolTip="Close"/>
</StackPanel>
<ContentPresenter ContentSource="{TemplateBinding Header}" VerticalAlignment="Stretch" HorizontalAlignment="Stretch"/>
</Grid>
<Grid Grid.RowSpan="2" x:Name="PART_ResizerContainers" Visibility="Hidden">
<Grid.Resources>
<sys:Double x:Key="StraightResizerSize">4</sys:Double>
<sys:Double x:Key="SlantResizerSize">8</sys:Double>
<Style TargetType="{x:Type Thumb}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate>
<Rectangle Fill="Transparent"/>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</Grid.Resources>
<Thumb Width="{StaticResource StraightResizerSize}" VerticalAlignment="Stretch" HorizontalAlignment="Left" Cursor="SizeWE" x:Name="PART_LeftResizer"/>
<Thumb Height="{StaticResource StraightResizerSize}" VerticalAlignment="Top" HorizontalAlignment="Stretch" Cursor="SizeNS" x:Name="PART_TopResizer"/>
<Thumb Width="{StaticResource StraightResizerSize}" VerticalAlignment="Stretch" HorizontalAlignment="Right" Cursor="SizeWE" x:Name="PART_RightResizer"/>
<Thumb Height="{StaticResource StraightResizerSize}" VerticalAlignment="Bottom" HorizontalAlignment="Stretch" Cursor="SizeNS" x:Name="PART_BottomResizer"/>
<ResizeGrip Width="{StaticResource SlantResizerSize}" Height="{StaticResource SlantResizerSize}" HorizontalAlignment="Right" VerticalAlignment="Bottom" Visibility="{Binding RelativeSource={ x:Static RelativeSource.TemplatedParent}, Path=ShowResizeGrip, Converter={ StaticResource BoolToVisibilityConverter }}"/>
<Thumb Width="{StaticResource SlantResizerSize}" Height="{StaticResource SlantResizerSize}" HorizontalAlignment="Right" VerticalAlignment="Bottom" Cursor="SizeNWSE" x:Name="PART_BottomRightResizer"/>
<Thumb Width="{StaticResource SlantResizerSize}" Height="{StaticResource SlantResizerSize}" HorizontalAlignment="Right" VerticalAlignment="Top" Cursor="SizeNESW" x:Name="PART_TopRightResizer"/>
<Thumb Width="{StaticResource SlantResizerSize}" Height="{StaticResource SlantResizerSize}" HorizontalAlignment="Left" VerticalAlignment="Top" Cursor="SizeNWSE" x:Name="PART_TopLeftResizer"/>
<Thumb Width="{StaticResource SlantResizerSize}" Height="{StaticResource SlantResizerSize}" HorizontalAlignment="Left" VerticalAlignment="Bottom" Cursor="SizeNESW" x:Name="PART_BottomLeftResizer"/>
</Grid>
<Border x:Name="PART_ContentBorder" Grid.Row="1" Margin="7,0,7,7" ClipToBounds="True" Background="White">
<AdornerDecorator>
<ContentPresenter Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"/>
</AdornerDecorator>
</Border>
</Grid>
</Border>
<ControlTemplate.Triggers>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="CanResize" Value="True"/>
<Condition Property="WindowState" Value="Normal"/>
</MultiTrigger.Conditions>
<Setter TargetName="PART_ResizerContainers" Property="Visibility" Value="Visible"/>
</MultiTrigger>
<Trigger Property="WindowState" Value="Maximized">
<Setter TargetName="PART_ContentBorder" Property="Margin" Value="0"/>
<Setter TargetName="PART_ContentBorder" Property="BorderThickness" Value="0,2,0,0"/>
<Setter TargetName="HeaderRow" Property="Height" Value="25"/>
</Trigger>
<Trigger Property="IsActive" Value="False">
<Setter Property="Background" Value="{StaticResource DeactiveBackground}"/>
<Setter TargetName="PART_MinimizeButton" Property="Background" Value="{StaticResource DeactiveBackground}"/>
<Setter TargetName="PART_RestoreButton" Property="Background" Value="{StaticResource DeactiveBackground}"/>
<Setter TargetName="PART_CloseButton" Property="Background" Value="{StaticResource DeactiveBackground}"/>
</Trigger>
<Trigger Property="IsActive" Value="True">
<Setter Property="Background" Value="{StaticResource ActiveBackground}"/>
<Setter TargetName="PART_MinimizeButton" Property="Background" Value="{StaticResource ActiveBackground}"/>
<Setter TargetName="PART_RestoreButton" Property="Background" Value="{StaticResource ActiveBackground}"/>
<Setter TargetName="PART_CloseButton" Property="Background" Value="#FFC35A50"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
HeaderedWindwo.cs
public class HeaderedWindow : Window
{
#region 模板中的部分控件名称
private const string HeaderContainerName = "PART_HeaderContainer";
private const string MinimizeButtonName = "PART_MinimizeButton";
private const string RestoreButtonName = "PART_RestoreButton";
private const string CloseButtonName = "PART_CloseButton";
private const string TopResizerName = "PART_TopResizer";
private const string LeftResizerName = "PART_LeftResizer";
private const string RightResizerName = "PART_RightResizer";
private const string BottomResizerName = "PART_BottomResizer";
private const string BottomRightResizerName = "PART_BottomRightResizer";
private const string TopRightResizerName = "PART_TopRightResizer";
private const string TopLeftResizerName = "PART_TopLeftResizer";
private const string BottomLeftResizerName = "PART_BottomLeftResizer";
#endregion #region 依赖属性
public static readonly DependencyProperty ShowDefaultHeaderProperty =
DependencyProperty.Register("ShowDefaultHeader", typeof(bool), typeof(HeaderedWindow), new FrameworkPropertyMetadata(true)); public static readonly DependencyProperty ShowResizeGripProperty =
DependencyProperty.Register("ShowResizeGrip", typeof(bool), typeof(HeaderedWindow), new FrameworkPropertyMetadata(false)); public static readonly DependencyProperty CanResizeProperty =
DependencyProperty.Register("CanResize", typeof(bool), typeof(HeaderedWindow), new FrameworkPropertyMetadata(true)); public static readonly DependencyProperty HeaderProperty =
DependencyProperty.Register("Header", typeof(object), typeof(HeaderedWindow), new FrameworkPropertyMetadata(null, OnHeaderChanged)); public static readonly DependencyProperty HeaderTemplateProperty =
DependencyProperty.Register("HeaderTemplate", typeof(DataTemplate), typeof(HeaderedWindow), new FrameworkPropertyMetadata(null)); public static readonly DependencyProperty HeaderTempateSelectorProperty =
DependencyProperty.Register("HeaderTempateSelector", typeof(DataTemplateSelector), typeof(HeaderedWindow), new FrameworkPropertyMetadata(null)); public static readonly DependencyProperty IsFullScreenMaximizeProperty =
DependencyProperty.Register("IsFullScreenMaximize", typeof(bool), typeof(HeaderedWindow), new FrameworkPropertyMetadata(false)); private static void OnHeaderChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
{
HeaderedWindow win = sender as HeaderedWindow;
win.RemoveLogicalChild(e.OldValue);
win.AddLogicalChild(e.NewValue);
} public bool ShowDefaultHeader
{
get { return (bool)GetValue(ShowDefaultHeaderProperty); }
set { SetValue(ShowDefaultHeaderProperty, value); }
} public bool CanResize
{
get { return (bool)GetValue(CanResizeProperty); }
set { SetValue(CanResizeProperty, value); }
} public bool ShowResizeGrip
{
get { return (bool)GetValue(ShowResizeGripProperty); }
set { SetValue(ShowResizeGripProperty, value); }
} public object Header
{
get { return (object)GetValue(HeaderProperty); }
set { SetValue(HeaderProperty, value); }
} public DataTemplate HeaderTemplate
{
get { return (DataTemplate)GetValue(HeaderTemplateProperty); }
set { SetValue(HeaderTemplateProperty, value); }
} public DataTemplateSelector HeaderTempateSelector
{
get { return (DataTemplateSelector)GetValue(HeaderTempateSelectorProperty); }
set { SetValue(HeaderTempateSelectorProperty, value); }
} public bool IsFullScreenMaximize
{
get { return (bool)GetValue(IsFullScreenMaximizeProperty); }
set { SetValue(IsFullScreenMaximizeProperty, value); }
} #endregion static HeaderedWindow()
{
DefaultStyleKeyProperty.OverrideMetadata(typeof(HeaderedWindow), new FrameworkPropertyMetadata(typeof(HeaderedWindow)));
} #region 私有变量 private FrameworkElement headerContainer;
private Button minimizeButton;
private ToggleButton restoreButton;
private Button closeButton;
private Thumb topResizer;
private Thumb leftResizer;
private Thumb rightResizer;
private Thumb bottomResizer;
private Thumb bottomRightResizer;
private Thumb topRightResizer;
private Thumb topLeftResizer;
private Thumb bottomLeftResizer;
#endregion #region 重写函数 public override void OnApplyTemplate()
{
base.OnApplyTemplate();
headerContainer = GetTemplateChild<FrameworkElement>(HeaderContainerName);
headerContainer.MouseLeftButtonDown += HeaderContainerMouseLeftButtonDown;
closeButton = GetTemplateChild<Button>(CloseButtonName);
closeButton.Click += delegate { Close(); };
restoreButton = GetTemplateChild<ToggleButton>(RestoreButtonName);
restoreButton.Checked += delegate { ChangeWindowState(WindowState.Maximized); };
restoreButton.Unchecked += delegate { ChangeWindowState(WindowState.Normal); };
StateChanged += new EventHandler(HeaderedWindowStateChanged);
minimizeButton = GetTemplateChild<Button>(MinimizeButtonName);
minimizeButton.Click += delegate { ChangeWindowState(WindowState.Minimized); };
topResizer = GetTemplateChild<Thumb>(TopResizerName);
topResizer.DragDelta += new DragDeltaEventHandler(ResizeTop);
leftResizer = GetTemplateChild<Thumb>(LeftResizerName);
leftResizer.DragDelta += new DragDeltaEventHandler(ResizeLeft);
rightResizer = GetTemplateChild<Thumb>(RightResizerName);
rightResizer.DragDelta += new DragDeltaEventHandler(ResizeRight);
bottomResizer = GetTemplateChild<Thumb>(BottomResizerName);
bottomResizer.DragDelta += new DragDeltaEventHandler(ResizeBottom);
bottomRightResizer = GetTemplateChild<Thumb>(BottomRightResizerName);
bottomRightResizer.DragDelta += new DragDeltaEventHandler(ResizeBottomRight);
topRightResizer = GetTemplateChild<Thumb>(TopRightResizerName);
topRightResizer.DragDelta += new DragDeltaEventHandler(ResizeTopRight);
topLeftResizer = GetTemplateChild<Thumb>(TopLeftResizerName);
topLeftResizer.DragDelta += new DragDeltaEventHandler(ResizeTopLeft);
bottomLeftResizer = GetTemplateChild<Thumb>(BottomLeftResizerName);
bottomLeftResizer.DragDelta += new DragDeltaEventHandler(ResizeBottomLeft);
}
#endregion #region 辅助函数 private T GetTemplateChild<T>(string childName) where T : FrameworkElement
{
return (GetTemplateChild(childName) as T);
} /// <summary>
/// 鼠标左键单击拖动标题栏,双击窗体状态变化(最大化和还原)
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void HeaderContainerMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
if (e.ClickCount == )
{
DragMove();
}
else
{
ChangeWindowState(WindowState == WindowState.Maximized ? WindowState.Normal : WindowState.Maximized);
}
}
/// <summary>
/// 改变窗体状态
/// </summary>
/// <param name="state">Maximized,Normal,Minimized</param>
private void ChangeWindowState(WindowState state)
{
if (state == WindowState.Maximized)
{
if (!IsFullScreenMaximize && IsLocationOnPrimaryScreen())
{
MaxHeight = SystemParameters.WorkArea.Height;
MaxWidth = SystemParameters.WorkArea.Width;
}
else
{
MaxHeight = double.PositiveInfinity;
MaxWidth = double.PositiveInfinity;
}
}
WindowState = state;
} private void HeaderedWindowStateChanged(object sender, EventArgs e)
{
if (WindowState == WindowState.Minimized)
{
restoreButton.IsChecked = null;
}
else
{
restoreButton.IsChecked = WindowState == WindowState.Maximized;
}
}
/// <summary>
/// 判断控件是否位于主显示器中
/// </summary>
/// <returns></returns>
private bool IsLocationOnPrimaryScreen()
{
return Left < SystemParameters.PrimaryScreenWidth && Top < SystemParameters.PrimaryScreenHeight;
} #endregion #region 重置大小
private void ResizeBottomLeft(object sender, DragDeltaEventArgs e)
{
ResizeLeft(sender, e);
ResizeBottom(sender, e);
} private void ResizeTopLeft(object sender, DragDeltaEventArgs e)
{
ResizeTop(sender, e);
ResizeLeft(sender, e);
} private void ResizeTopRight(object sender, DragDeltaEventArgs e)
{
ResizeRight(sender, e);
ResizeTop(sender, e);
} private void ResizeBottomRight(object sender, DragDeltaEventArgs e)
{
ResizeBottom(sender, e);
ResizeRight(sender, e);
} private void ResizeBottom(object sender, DragDeltaEventArgs e)
{
if (ActualHeight <= MinHeight && e.VerticalChange < )
{
return;
}
if (double.IsNaN(Height))
{
Height = ActualHeight;
}
Height += e.VerticalChange;
} private void ResizeRight(object sender, DragDeltaEventArgs e)
{
if (ActualWidth <= MinWidth && e.HorizontalChange < )
{
return;
}
if (double.IsNaN(Width))
{
Width = ActualWidth;
}
Width += e.HorizontalChange;
} private void ResizeLeft(object sender, DragDeltaEventArgs e)
{
if (ActualWidth <= MinWidth && e.HorizontalChange > )
{
return;
} if (double.IsNaN(Width))
{
Width = ActualWidth;
} Width -= e.HorizontalChange;
Left += e.HorizontalChange;
} private void ResizeTop(object sender, DragDeltaEventArgs e)
{
if (ActualHeight <= MinHeight && e.VerticalChange > )
{
return;
}
if (double.IsNaN(Height))
{
Height = ActualHeight;
}
Height -= e.VerticalChange;
Top += e.VerticalChange;
}
#endregion
}
BoolToVisibilityConverter类
public class BoolToVisibilityConverter : IValueConverter
{
#region IValueConverter Members
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
return (bool)value ? Visibility.Visible : Visibility.Hidden;
}
public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
throw new NotImplementedException();
}
#endregion
}
WPF自定义窗口(Windows Server 2012 Style)的更多相关文章
- 在Windows Server 2012中如何快速开关桌面上经典的“计算机、我的文档”等通用图标
我们都知道,在Windows Server 2012系列的服务器版本中都已经引入了Modern的现代界面作为默认的用户交互界面,同时满足视觉一致化,新版的服务器管理程序也做成了扁平化.因此传统的计算机 ...
- 如何将 Windows Server 2012 r2 打造成 Windows 8.1?
Server 系列相对于桌面系统Windows 8.1 .嵌入式系统Embedded 8.1来说,还是有所不同的,有其独特性,所以,标题写着“打造”充其量不过是不断接近的意思.还有很多地方存在进一步深 ...
- Windows Server 2012 R2 IIS8.5+PHP(FastCGI)+MySQL环境搭建教程
原文地址:http://www.osyunwei.com/archives/7378.html 搬运是为了自己找资料方便. 准备篇 一.环境说明: 操作系统:Windows Server 2012 R ...
- WPF自定义窗口基类
WPF自定义窗口基类时,窗口基类只定义.cs文件,xaml文件不定义.继承自定义窗口的类xaml文件的根节点就不再是<Window>,而是自定义窗口类名(若自定义窗口与继承者不在同一个命名 ...
- Windows Server 2012 R2 IIS8.5+PHP(FastCGI)+MySQL环境搭建教程
准备篇 一.环境说明: 操作系统:Windows Server 2012 R2 PHP版本:php 5.5.8 MySQL版本:MySQL5.6.15 二.相关软件下载: 1.PHP下载地址: htt ...
- Windows server 2012 R2 部署WSUS补丁服务
一.WSUS 安装要求 1.硬件要求: 对于多达 13000 个客户端的服务器,建议使用以下硬件:* 4 Core E5-2609 2.1GHz 的处理器* 8 GB 的 RAM 2.软件要求: 要使 ...
- wpf 自定义窗口,最大化时覆盖任务栏解决方案
原文:wpf 自定义窗口,最大化时覆盖任务栏解决方案 相信很多人使用wpf时会选择自定义美观的窗口,因此会设置WindowStyle="None" 取消自带的标题栏.但这样使用 W ...
- Windows server 2012 添加中文语言包(英文转为中文)(离线)
Windows server 2012 添加中文语言包(英文转为中文)(离线) 相关资料: 公司环境:亚马孙aws虚拟机 英文版Windows2012 中文SQL Server2012安装包,需要安装 ...
- Windows Server 2012 NIC Teaming介绍及注意事项
Windows Server 2012 NIC Teaming介绍及注意事项 转载自:http://www.it165.net/os/html/201303/4799.html Windows Ser ...
随机推荐
- xls 和 xml 数据 排序 绑定 -原创
xls 和 xml 排序 xml: <?xml version="1.0" encoding="UTF-8"?> <?xml-styleshe ...
- oracle删除当前用户下所有表
1.如果有删除用户的权限,则可以: drop user user_name cascade; 加了cascade就可以把用户连带的数据全部删掉. 删除后再创建该用户.--创建管理员用户create u ...
- Yii AR Model CRUD数据库操作
Yii AR很好很强大,但刚开始不知道怎么使用,可以先看下官方文档 官方文档:http://www.yiichina.com/guide/database.ar 下面是我对AR的一些理解 对于一个Mo ...
- request&response笔记
一.HttpServletResponse 1.代表了一个响应 2.应用: 2.1输出中文 字节流输出中文 //拿到输出字节流对象 ServletOutputStream oos = response ...
- [一位菜鸟的COCOS-2D编程之路]COCOS2D中得动作,特效和动画
一,CCActionManager 管理所有节点动作的对象 来看看打飞机里面的一个onEnter 方法 - (void)onEnter { [super onEnter]; //一定要注意添加此方法, ...
- iOS 更好用的打Log方式-显示文件名、行数
单纯的NSLog方式打出的Log没有显示打印语句所在的文件名和行数,下面这种做法会很实用: #ifdef DEBUG # define DLog(fmt, ...) NSLog((@"%s ...
- pod 命令-bash: --: command not found
pod 命令-bash: --: command not found 升级完系统执行 pod update 或者 pod install命令的时候出现: -bash: --: command not ...
- 【转】java 解析 plist文件
为了方便的将spritesheet的图导入我自己的动画编辑器!我做了plist文件解析DOM解析比较麻烦 因为element getChildNodes 会获取到text对象.而这个对象可能是一个空白 ...
- 国外NET 空间免费申请使用
最近研究微信公众帐号接口开发,需要使用到域名和空间,所以在度娘和谷哥的帮助下找到国外免费的空间, 刚刚注册完所以截图和大家分享下 注册地址:http://member.mywindowshosting ...
- MySQL查询
DQL 操作 DQL 数据查询语言(重要) 数据库执行DQL语句不会对数据做出任何改变,而是让数据库发送结果集给客户端. 查询返回的结果是一张虚拟表. 查询关键字:SELECT ...