一、前言

       最近忙里偷闲,做了一个部署数据库及IIS网站站点的WPF应用程序工具。

二、内容

       此工具的目的是:

  1. 根据.sql文件在本机上部署数据库
  2. 在本机部署IIS站点,包括新建站点,新建应用程序池。只新建而不会对本机上原有的程序池或站点做修改操作

最终样式:(Check按钮的作用是防止与本机已有的站点或程序池有冲突)

View:

  1. <Window x:Class="AutoWebTool.MainWindow"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  5. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  6. xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
  7. xmlns:local="clr-namespace:AutoWebTool"
  8. Title="Web Site Automatic Deployment" Height="" Width="" WindowStartupLocation="CenterScreen" ResizeMode="NoResize">
  9. <Grid>
  10. <Grid.RowDefinitions>
  11. <RowDefinition Height="0.5*"/>
  12. <RowDefinition Height="0.5*"/>
  13. <RowDefinition Height="Auto"/>
  14. </Grid.RowDefinitions>
  15. <GroupBox Header="DataBase Configuration" FontSize="" BorderThickness="" Margin="5,10" Grid.Row="">
  16. <Grid>
  17. <Grid.RowDefinitions>
  18. <RowDefinition/>
  19. <RowDefinition/>
  20. <RowDefinition/>
  21. <RowDefinition/>
  22. </Grid.RowDefinitions>
  23. <Grid.ColumnDefinitions>
  24. <ColumnDefinition Width="65*"/>
  25. <ColumnDefinition Width="133*"/>
  26. <ColumnDefinition Width="Auto"/>
  27. </Grid.ColumnDefinitions>
  28.  
  29. <TextBlock Grid.Row="" Grid.Column="" Text="Server Address" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="" Height="" />
  30. <TextBlock Grid.Row="" Grid.Column="" Text="User" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="" Height="" />
  31. <TextBlock Grid.Row="" Grid.Column="" Text="Password" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="" Height="" />
  32. <TextBlock Grid.Row="" Grid.Column="" Text="Script Path" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="" Height="" />
  33.  
  34. <TextBox Grid.Row="" Grid.Column="" Text="{Binding ServerAddress, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
  35. HorizontalAlignment="Left" VerticalAlignment="Center" FontSize="" Width="" Height="" />
  36. <TextBox Grid.Row="" Grid.Column="" Text="{Binding User, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
  37. HorizontalAlignment="Left" VerticalAlignment="Center" FontSize="" Width="" Height="" />
  38. <PasswordBox Grid.Row="" Grid.Column="" PasswordChar="*" local:PasswordBoxHelper.Password="{Binding Password, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
  39. HorizontalAlignment="Left" VerticalAlignment="Center" FontSize="" Width="" Height="">
  40. <i:Interaction.Behaviors>
  41. <local:PasswordBoxBehavior />
  42. </i:Interaction.Behaviors>
  43. </PasswordBox>
  44. <TextBox Grid.Row="" Grid.Column="" Text="{Binding SqlPath, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
  45. HorizontalAlignment="Left" VerticalAlignment="Center" FontSize="" Width="" Height="" />
  46.  
  47. <Button Grid.Row="" Grid.Column="" Width="" Height="" Margin="0,0,10,0"
  48. HorizontalAlignment="Left" VerticalAlignment="Center" Content="Browse" Click="FilePathBrowse_Click"/>
  49. </Grid>
  50. </GroupBox>
  51. <GroupBox Header="WebSite And Pool" FontSize="" BorderThickness="" Margin="5,10" Grid.Row="">
  52. <Grid>
  53. <Grid.RowDefinitions>
  54. <RowDefinition/>
  55. <RowDefinition/>
  56. <RowDefinition/>
  57. <RowDefinition/>
  58. <RowDefinition/>
  59. </Grid.RowDefinitions>
  60. <Grid.ColumnDefinitions>
  61. <ColumnDefinition Width="65*"/>
  62. <ColumnDefinition Width="133*"/>
  63. <ColumnDefinition Width="Auto"/>
  64. </Grid.ColumnDefinitions>
  65.  
  66. <TextBlock Grid.Row="" Grid.Column="" Text="WebSite Name" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="" Height="" />
  67. <TextBlock Grid.Row="" Grid.Column="" Text="WebSite ID" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="" Height="" />
  68. <TextBlock Grid.Row="" Grid.Column="" Text="WebSite PhysicalPath" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="" Height="" />
  69. <TextBlock Grid.Row="" Grid.Column="" Text="WebSite Port" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="" Height="" />
  70. <TextBlock Grid.Row="" Grid.Column="" Text="Application Pool Name" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="" Height=""/>
  71.  
  72. <TextBox Grid.Row="" Grid.Column="" Text="{Binding WebSiteName, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
  73. HorizontalAlignment="Left" VerticalAlignment="Center" FontSize="" Width="" Height="" />
  74. <TextBox Grid.Row="" Grid.Column="" Text="{Binding WebSiteID, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
  75. HorizontalAlignment="Left" VerticalAlignment="Center" FontSize="" Width="" Height="" />
  76. <TextBox Grid.Row="" Grid.Column="" Text="{Binding PhysicalPath, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
  77. HorizontalAlignment="Left" VerticalAlignment="Center" FontSize="" Width="" Height="" />
  78. <TextBox Grid.Row="" Grid.Column="" Text="{Binding WebSitePort, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
  79. HorizontalAlignment="Left" VerticalAlignment="Center" FontSize="" Width="" Height="" />
  80. <TextBox Grid.Row="" Grid.Column="" Text="{Binding PoolName, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
  81. HorizontalAlignment="Left" VerticalAlignment="Center" FontSize="" Width="" Height="" />
  82.  
  83. <Button Grid.Row="" Grid.Column="" Width="" Height="" Margin="0,0,10,0"
  84. HorizontalAlignment="Left" VerticalAlignment="Center" Content="Check" Click="WebSiteNameCheck_Click"/>
  85. <Button Grid.Row="" Grid.Column="" Width="" Height="" Margin="0,0,10,0"
  86. HorizontalAlignment="Left" VerticalAlignment="Center" Content="Check" Click="WebSiteIDCheck_Click"/>
  87. <Button Grid.Row="" Grid.Column="" Width="" Height="" Margin="0,0,10,0"
  88. HorizontalAlignment="Left" VerticalAlignment="Center" Content="Browse" Click="PathBrowse_Click"/>
  89. <Button Grid.Row="" Grid.Column="" Width="" Height="" Margin="0,0,10,0"
  90. HorizontalAlignment="Left" VerticalAlignment="Center" Content="Check" Click="WebSitePortCheck_Click"/>
  91. <Button Grid.Row="" Grid.Column="" Width="" Height="" Margin="0,0,10,0"
  92. HorizontalAlignment="Left" VerticalAlignment="Center" Content="Check" Click="PoolNameCheck_Click"/>
  93. </Grid>
  94. </GroupBox>
  95. <StackPanel Grid.Row="" Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="">
  96. <Button Width="" Height="" Content="OK" Click="Deploy_Click"/>
  97. <Button Width="" Height="" Content="Cancel" Margin="10,0,0,0" Click="Close_Click"/>
  98. </StackPanel>
  99. </Grid>
  100. </Window>

View的后台文件:

  1. using System.Windows;
  2. using System.Windows.Controls;
  3. using System.Windows.Interactivity;
  4.  
  5. namespace AutoWebTool
  6. {
  7. /// <summary>
  8. /// MainWindow.xaml 的交互逻辑
  9. /// </summary>
  10. public partial class MainWindow : Window
  11. {
  12. private AutoGenerationVM _vm;
  13.  
  14. public MainWindow()
  15. {
  16. InitializeComponent();
  17. DataContext = new AutoGenerationVM();
  18. _vm = DataContext as AutoGenerationVM;
  19. }
  20.  
  21. private bool sqlPath;
  22. private void FilePathBrowse_Click(object sender, RoutedEventArgs e)
  23. {
  24. sqlPath = _vm.GetSqlFilePath();
  25. }
  26.  
  27. private void WebSiteNameCheck_Click(object sender, RoutedEventArgs e)
  28. {
  29. var isInUse = _vm.CheckNameAndID();
  30. if (isInUse)
  31. {
  32. MessageBox.Show("1.This name is Empty \r\n2.This name is in use,please change name!");
  33. }
  34. else
  35. {
  36. MessageBox.Show("No Problem!");
  37. }
  38. }
  39.  
  40. private void WebSiteIDCheck_Click(object sender, RoutedEventArgs e)
  41. {
  42. var isInUse = _vm.CheckNameAndID();
  43. if (isInUse)
  44. {
  45. MessageBox.Show("1.This ID is Empty \r\n2.This ID is in use,please change ID!");
  46. }
  47. else
  48. {
  49. MessageBox.Show("No Problem!");
  50. }
  51. }
  52.  
  53. private bool physicalPath;
  54. private void PathBrowse_Click(object sender, RoutedEventArgs e)
  55. {
  56. physicalPath = _vm.GetFolderPath();
  57. }
  58. private void WebSitePortCheck_Click(object sender, RoutedEventArgs e)
  59. {
  60. var isInUse = _vm.CheckWebPort();
  61. if (isInUse)
  62. {
  63. MessageBox.Show("1.This port is Empty \r\n2.This port is in use,please change port!");
  64. }
  65. else
  66. {
  67. MessageBox.Show("No Problem!");
  68. }
  69. }
  70. private void PoolNameCheck_Click(object sender, RoutedEventArgs e)
  71. {
  72. var isInUse = _vm.CkeckPoolName();
  73. if (isInUse)
  74. {
  75. MessageBox.Show("1.This pool name is Empty \r\n2.This name is in use,please change name!");
  76. }
  77. else
  78. {
  79. MessageBox.Show("No Problem!");
  80. }
  81. }
  82.  
  83. private void Deploy_Click(object sender, RoutedEventArgs e)
  84. {
  85. var dataBaseServerAddressChecked = string.IsNullOrEmpty(_vm.ServerAddress);
  86. var dataBaseUserChecked = string.IsNullOrEmpty(_vm.User);
  87. var dataBasePasswordChecked = string.IsNullOrEmpty(_vm.Password);
  88. var dataBaseScriptChecked = sqlPath;
  89. var dataBaseCondition = !dataBaseServerAddressChecked && !dataBaseUserChecked && !dataBasePasswordChecked && !dataBaseScriptChecked;
  90.  
  91. var webSiteNameAndIDChecked = _vm.CheckNameAndID();
  92. var webSitePortChecked = _vm.CheckWebPort();
  93. var applicationPoolNameChecked = _vm.CkeckPoolName();
  94. var webSiteCondition = !webSiteNameAndIDChecked && !physicalPath && !webSitePortChecked && !applicationPoolNameChecked;
  95.  
  96. if (dataBaseCondition&& webSiteCondition)
  97. {
  98. _vm.Execute();
  99. }
  100. else {
  101. MessageBox.Show("Please Check Your Input!");
  102. }
  103. }
  104.  
  105. private void Close_Click(object sender, RoutedEventArgs e)
  106. {
  107. Close();
  108. }
  109. }
  110.  
  111. public static class PasswordBoxHelper
  112. {
  113. public static readonly DependencyProperty PasswordProperty =
  114. DependencyProperty.RegisterAttached("Password",
  115. typeof(string), typeof(PasswordBoxHelper),
  116. new FrameworkPropertyMetadata(string.Empty, OnPasswordPropertyChanged));
  117.  
  118. private static void OnPasswordPropertyChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
  119. {
  120. var passwordBox = sender as PasswordBox;
  121.  
  122. string password = (string)e.NewValue;
  123.  
  124. if (passwordBox != null && passwordBox.Password != password)
  125. {
  126. passwordBox.Password = password;
  127. }
  128. }
  129.  
  130. public static string GetPassword(DependencyObject dp)
  131. {
  132. return (string)dp.GetValue(PasswordProperty);
  133. }
  134.  
  135. public static void SetPassword(DependencyObject dp, string value)
  136. {
  137. dp.SetValue(PasswordProperty, value);
  138. }
  139. }
  140.  
  141. public class PasswordBoxBehavior : Behavior<PasswordBox>
  142. {
  143. protected override void OnAttached()
  144. {
  145. base.OnAttached();
  146.  
  147. AssociatedObject.PasswordChanged += OnPasswordChanged;
  148. }
  149.  
  150. private static void OnPasswordChanged(object sender, RoutedEventArgs e)
  151. {
  152. var passwordBox = sender as PasswordBox;
  153.  
  154. string password = PasswordBoxHelper.GetPassword(passwordBox);
  155.  
  156. if (passwordBox != null && passwordBox.Password != password)
  157. {
  158. PasswordBoxHelper.SetPassword(passwordBox, passwordBox.Password);
  159. }
  160. }
  161.  
  162. protected override void OnDetaching()
  163. {
  164. base.OnDetaching();
  165.  
  166. AssociatedObject.PasswordChanged -= OnPasswordChanged;
  167. }
  168. }
  169. }

ViewModel:

  1. using System;
  2. using System.DirectoryServices;
  3. using System.ComponentModel;
  4. using System.Linq;
  5. using System.Net;
  6. using System.Net.NetworkInformation;
  7. using Microsoft.Web.Administration;
  8. using System.Windows.Forms;
  9. using System.Diagnostics;
  10. using System.Data.SqlClient;
  11. using System.IO;
  12.  
  13. namespace AutoWebTool
  14. {
  15. public class AutoGenerationVM : INotifyPropertyChanged
  16. {
  17.  
  18. public AutoGenerationVM()
  19. {
  20. _physicalPath = AppDomain.CurrentDomain.BaseDirectory;
  21. }
  22.  
  23. //DataBase ServerAddress
  24. private string _serverAddress = string.Empty;
  25.  
  26. public string ServerAddress
  27. {
  28. get { return _serverAddress; }
  29. set
  30. {
  31. if (_serverAddress != value)
  32. {
  33. _serverAddress = value;
  34. NotifyPropertyChanged("ServerAddress");
  35. }
  36. }
  37. }
  38.  
  39. //DataBase User
  40. private string _user = string.Empty;
  41.  
  42. public string User
  43. {
  44. get { return _user; }
  45. set
  46. {
  47. if (_user != value)
  48. {
  49. _user = value;
  50. NotifyPropertyChanged("User");
  51. }
  52. }
  53. }
  54.  
  55. //DataBase Password
  56. private string _password = string.Empty;
  57.  
  58. public string Password
  59. {
  60. get { return _password; }
  61. set
  62. {
  63. if (_password != value)
  64. {
  65. _password = value;
  66. NotifyPropertyChanged("Password");
  67. }
  68. }
  69. }
  70.  
  71. //DataBase SQLPath
  72. private string _sqlPath = string.Empty;
  73.  
  74. public string SqlPath
  75. {
  76. get { return _sqlPath; }
  77. set
  78. {
  79. if (_sqlPath != value)
  80. {
  81. _sqlPath = value;
  82. NotifyPropertyChanged("SqlPath");
  83. }
  84. }
  85. }
  86.  
  87. public bool GetSqlFilePath() {
  88.  
  89. var openFileDialog = new OpenFileDialog();
  90. openFileDialog.Filter = "数据库脚本文件|*.sql";
  91. if (openFileDialog.ShowDialog() == DialogResult.OK)
  92. {
  93. SqlPath = openFileDialog.FileName;
  94. }
  95. return false;
  96. }
  97.  
  98. //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  99. //WebSite Name
  100. private string _webSiteName = string.Empty;
  101.  
  102. public string WebSiteName
  103. {
  104. get { return _webSiteName; }
  105. set
  106. {
  107. if (_webSiteName != value)
  108. {
  109. _webSiteName = value;
  110. NotifyPropertyChanged("WebSiteName");
  111. }
  112. }
  113. }
  114.  
  115. //WebSite ID
  116. private string _webSiteID = string.Empty;
  117.  
  118. public string WebSiteID
  119. {
  120. get { return _webSiteID; }
  121. set
  122. {
  123. if (_webSiteID != value)
  124. {
  125. _webSiteID = value;
  126. NotifyPropertyChanged("WebSiteID");
  127. }
  128. }
  129. }
  130.  
  131. /// <summary>
  132. /// Check WebSite Name and ID
  133. /// </summary>
  134. /// <returns></returns>
  135. public bool CheckNameAndID()
  136. {
  137. if (string.IsNullOrEmpty(WebSiteName) || string.IsNullOrEmpty(WebSiteID)) return true;
  138.  
  139. DirectoryEntry rootEntry = new DirectoryEntry("IIS://localhost/w3svc");
  140. foreach (DirectoryEntry entry in rootEntry.Children)
  141. {
  142. if (entry.SchemaClassName.Equals("IIsWebServer", StringComparison.OrdinalIgnoreCase))
  143. {
  144. if (WebSiteID == entry.Name) {
  145. return true;
  146. }
  147. if (entry.Properties["ServerComment"].Value.ToString() == WebSiteName)
  148. {
  149. return true;
  150. }
  151. }
  152. }
  153. return false;
  154. }
  155.  
  156. //Physical Path
  157. private string _physicalPath = string.Empty;
  158.  
  159. public string PhysicalPath
  160. {
  161. get { return _physicalPath; }
  162. set
  163. {
  164. if (_physicalPath != value)
  165. {
  166. _physicalPath = value;
  167. NotifyPropertyChanged("PhysicalPath");
  168. }
  169. }
  170. }
  171.  
  172. /// <summary>
  173. /// Get Path for WebSite
  174. /// </summary>
  175. public bool GetFolderPath()
  176. {
  177. if (string.IsNullOrEmpty(PhysicalPath)) return true;
  178. var openFolderDialog = new FolderBrowserDialog();
  179. if (openFolderDialog.ShowDialog() == DialogResult.OK)
  180. {
  181. PhysicalPath = openFolderDialog.SelectedPath;
  182. }
  183. return false;
  184. }
  185.  
  186. //WebSite Port
  187. private string _webSitePort = string.Empty;
  188.  
  189. public string WebSitePort
  190. {
  191. get { return _webSitePort; }
  192. set
  193. {
  194. if (_webSitePort != value)
  195. {
  196. _webSitePort = value;
  197. NotifyPropertyChanged("WebSitePort");
  198. }
  199. }
  200. }
  201.  
  202. /// <summary>
  203. /// Check WebSite Port
  204. /// </summary>
  205. /// <returns></returns>
  206. public bool CheckWebPort()
  207. {
  208. try
  209. {
  210. IPGlobalProperties ipProperties = IPGlobalProperties.GetIPGlobalProperties();
  211. IPEndPoint[] ipEndPoints = ipProperties.GetActiveTcpListeners();
  212.  
  213. foreach (IPEndPoint endPoint in ipEndPoints)
  214. {
  215. if (endPoint.Port == Convert.ToInt32(WebSitePort))
  216. {
  217. return true;
  218. }
  219. }
  220. return false;
  221.  
  222. }
  223. catch {
  224.  
  225. return true;
  226. }
  227. }
  228.  
  229. //Pool Name
  230. private string _poolName = string.Empty;
  231.  
  232. public string PoolName
  233. {
  234. get { return _poolName; }
  235. set
  236. {
  237. if (_poolName != value)
  238. {
  239. _poolName = value;
  240. NotifyPropertyChanged("PoolName");
  241. }
  242. }
  243. }
  244.  
  245. /// <summary>
  246. /// Check Application Pool Name
  247. /// </summary>
  248. /// <returns></returns>
  249. public bool CkeckPoolName()
  250. {
  251. if (string.IsNullOrEmpty(PoolName)) return true;
  252. var manager = new ServerManager();
  253. var list = manager.ApplicationPools;
  254. var matchedItem = list.FirstOrDefault(x => x.Name == PoolName);
  255. if (matchedItem != null)
  256. return true;
  257. return false;
  258. }
  259.  
  260. /// <summary>
  261. /// Execute Script
  262. /// </summary>
  263. public void Execute()
  264. {
  265. //Deploy DataBase
  266. var tmpConn = new SqlConnection();
  267. tmpConn.ConnectionString = "SERVER = " + ServerAddress +"; DATABASE = master; User ID = " + User+ "; Pwd = " + Password+ ";";
  268. var scriptFile = new FileInfo(SqlPath);
  269. var sqlCreateDBQuery = scriptFile.OpenText().ReadToEnd();
  270. SqlCommand myCommand = new SqlCommand(sqlCreateDBQuery, tmpConn);
  271. try
  272. {
  273. tmpConn.Open();
  274. myCommand.ExecuteNonQuery();
  275. MessageBox.Show("Database has been created successfully!","Create Database", MessageBoxButtons.OK,MessageBoxIcon.Information);
  276. }
  277. catch (Exception ex)
  278. {
  279. MessageBox.Show(ex.ToString(), "Create Database", MessageBoxButtons.OK, MessageBoxIcon.Information);
  280. return;
  281. }
  282. finally
  283. {
  284. tmpConn.Close();
  285.  
  286. }
  287.  
  288. try
  289. {
  290. //Deploy WebSite and Application Pool
  291. var script = "net start w3svc " +
  292. "& cd c:/Windows/System32/inetsrv " +
  293. "& appcmd add site /name:" + WebSiteName + " /id:" + WebSiteID +
  294. " /physicalPath:" + PhysicalPath + " /bindings:http/*:" + WebSitePort + ":" + WebSiteName +
  295. " & appcmd add apppool /name:" + PoolName + " /managedRuntimeVersion:v4.0 /managedPipelineMode:Integrated" +
  296. " & appcmd set site /site.name:" + WebSiteName + " /[path='/'].applicationPool:" + PoolName;
  297.  
  298. ProcessStartInfo startInfo = new ProcessStartInfo();
  299. startInfo.WorkingDirectory = @"C:\Windows\System32";
  300. startInfo.FileName = @"C:\Windows\System32\cmd.exe";
  301. startInfo.RedirectStandardInput = true;
  302. startInfo.RedirectStandardOutput = true;
  303. startInfo.RedirectStandardError = true;
  304. startInfo.UseShellExecute = false;
  305. startInfo.Verb = "RunAs";
  306.  
  307. Process process = new Process();
  308. process.StartInfo = startInfo;
  309. process.Start();
  310. process.StandardInput.WriteLine(script);
  311. process.StandardInput.WriteLine("&exit");
  312. process.StandardInput.Flush();
  313. process.StandardInput.Close();
  314. process.WaitForExit();
  315.  
  316. MessageBox.Show("IIS WebSite and Application Pool Deployed Successfully!", "Create WebSite and Application Pool", MessageBoxButtons.OK, MessageBoxIcon.Information);
  317. }
  318. catch (Exception ex)
  319. {
  320. MessageBox.Show(ex.ToString(), "Exception", MessageBoxButtons.OK, MessageBoxIcon.Information);
  321. }
  322. }
  323.  
  324. public event PropertyChangedEventHandler PropertyChanged;
  325. private void NotifyPropertyChanged(string name)
  326. {
  327. PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(name));
  328. }
  329. }
  330. }

C#基础-代码部署数据库及IIS站点的更多相关文章

  1. ASP.NET Boilerplate 学习 AspNet Core2 浏览器缓存使用 c#基础,单线程,跨线程访问和线程带参数 wpf 禁用启用webbroswer右键菜单 EF Core 2.0使用MsSql/MySql实现DB First和Code First ASP.NET Core部署到Windows IIS QRCode.js:使用 JavaScript 生成

    ASP.NET Boilerplate 学习   1.在http://www.aspnetboilerplate.com/Templates 网站下载ABP模版 2.解压后打开解决方案,解决方案目录: ...

  2. iis 站点部署后 Microsof .Net Framework异常

    最近在部署站点到 iis 中时,遇到 iis 崩溃的问题,一打开部署好 的站点后,就出现 Microsoft .Net Framework 异常的消息提示,具体的 异常情况如下: 于是在网上查找了很多 ...

  3. 通过代码动态创建IIS站点

    对WebApi进行单元测试时,一般需要一个IIS站点,一般的做法,是通过写一个批处理的bat脚本来实现,其实通过编码,也能实现该功能. 主要有关注三点:应用程序池.Web站点.绑定(协议类型:http ...

  4. 将php代码部署到新浪云测试(简单方法,包含数据库的连接)

    很多人做项目都是先在本地测试然后上传到服务器运行,如果包含了操作数据库的信息往往需要进行一番调试,这里我总结一下把php代码包含数据库的连接如何上传到新浪云服务器的步骤. 1.在新浪云应用SAE的控制 ...

  5. 记一次 IIS 站点配置文件备份和还原,物理路径文件批量备份

    前言 上一篇文章实现了数据库的批量备份和还原,当然部署在服务器中的IIS站点备份也是一个十分繁琐的事,三四个数量不多的还好,像有一些服务器用了许久,承载几十个站点甚至更多,一个一个备份,再一个一个还原 ...

  6. 使用delphi+intraweb进行微信开发2—intraweb以.net方式发布(以asp.net mvc4模式部署)在IIS(.net虚拟主机)上

    在第一讲使用delphi+intraweb进行微信开发1--微信平台接入中我们编写了一个简单的微信接口程序,这个程序我是用Stand Alone Server / Service 方式编译的程序,并且 ...

  7. 在IIS站点中Adomd.net集成认证账号问题

    最近在做一个Asp.net项目的时候 ,在C#代码里面用到了Adomd.net去连接SSAS服务器做MDX查询,开发完成后将Asp.net代码部署到IIS后发现Adomd.net老是连接不到SSAS服 ...

  8. OpenStack实践系列①openstack简介及基础环境部署

    OpenStack实践系列①openstack简介及基础环境部署 一.OpenStack初探1.1 OpenStack简介 OpenStack是一整套开源软件项目的综合,它允许企业或服务提供者建立.运 ...

  9. asp.net中 使用Nginx 配置 IIS站点负载均衡

    这是一偏初学者入门的内容,发现有问题的地方,欢迎留言,一起学习,一起进步 本文主要记录一下在Windows平台中,IIS站点如何使用Nginx 做一个简单的负载均衡  一. 准备工作: 官网下载安装包 ...

随机推荐

  1. 6. 使用antd pro构建web页面

    前言 在开始之前,希望我们已经掌握了一部分react的知识,由于没有太多经验,其实我也是属于摸索阶段.这里假定我们已经了解了react,redux和dva/umi相关的知识.并有做过相关练习. 如果还 ...

  2. Netty源码分析第5章(ByteBuf)---->第5节: directArena分配缓冲区概述

    Netty源码分析第五章: ByteBuf 第五节: directArena分配缓冲区概述 上一小节简单分析了PooledByteBufAllocator中, 线程局部缓存和arean的相关逻辑, 这 ...

  3. windows c++如何使窗口动态改变位置

    在windows软件中,经常会碰到一个功能:鼠标hover在某个地方时会出现窗口,有时候这个窗口的位置是会动态调整的. 熟悉使用windows API,理解windows中虚拟坐标.工作区坐标.屏幕坐 ...

  4. 关于jQuery Form Plugin使用心得

    吐槽一下先 好久没开发了,今天遇到一个客户form提交的问题,想把form提交从同步变成ajax的异步方式,在网页接受返回来的数据,使用的是jquery from插件,于是网上搜了一圈,博客园,csd ...

  5. AI入门课程资源

    企业 kaggle https://www.kaggle.com/learn/overview Google   介绍 https://developers.google.cn/machine-lea ...

  6. 亚马逊如何变成 SOA(面向服务的架构)

    . 亚马逊公司不仅是世界最大的网络书店,还是世界最大的云服务商.它是怎么实现从电商到云商的转变呢? 一切都是CEO杰夫·贝索斯促成的,他对市场有着超乎常人的理解和预见. 2. 2000年前后,贝索斯有 ...

  7. 2-Eighth Scrum Meeting20151208

    任务分配 闫昊: 今日完成:和唐彬讨论研究上届的网络接口代码. 明日任务:商讨如何迁移ios代码到android平台. 唐彬: 今日完成:和闫昊讨论研究上届的网络接口代码. 明日任务:商讨如何迁移io ...

  8. Python学习二

    list  [ ] Python内置的一种数据类型是列表:list.list是一种有序的集合,可以随时添加和删除其中的元素 classmates = ['Michael', 'Bob', 'Tracy ...

  9. Internet History, Technology and Security (Week6)

    Week6 The Internet is desinged based on four-layer model. Each layer builds on the layers below it. ...

  10. 四则运算结对项目之GUI

    本次结对编程让我学到了许多许多知识,受益匪浅!在此之前,我没想过我能做出一个双击运行的小程序. 感谢我的队友与我同心协力,感谢室友宇欣告诉我操作符为“最多多少”而不是“多少”并教我使用效能分析工具,感 ...