Response.Write(Convert.ToInt32("94"));
Response.Write("<br/>");
Response.Write(Convert.ToInt32(94.5)); //會四捨六入五成雙
Response.Write("<br/>");
Response.Write((94.5).ToString("N0")); //會四捨五入
Response.Write("<br/>");
Response.Write((95.5).ToString("N0")); //會四捨五入
Response.Write("<br/>");
Response.Write(Convert.ToInt32(null)); //會 return 0
Response.Write("<br/>");
Response.Write(Convert.ToInt32("94.55")); //會有 exception 要先轉成 double 之類的數值
Response.Write("<br/>");
Command: Update Error: Previous operation has not finished; run 'cleanup' if it was interrupted Error: Please execute the 'Cleanup' command. Completed!:
sqlite3.exe .svn/wc.db "select * from work_queue"
qlite3.exe .svn/wc.db "delete from work_queue"
<system.web>
<httpRuntime requestValidationMode="2.0" maxRequestLength="1024000"/>
</system.web>
public string UploadFilesToRemoteUrl(string url, string[] files, NameValueCollection formFields = null)
{
string boundary = "----------------------------" + DateTime.Now.Ticks.ToString("x");
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
request.ContentType = "multipart/form-data; boundary=" +
boundary;
request.Method = "POST";
request.KeepAlive = true;
Stream memStream = new System.IO.MemoryStream();
var boundarybytes = System.Text.Encoding.ASCII.GetBytes("\r\n--" +
boundary + "\r\n");
var endBoundaryBytes = System.Text.Encoding.ASCII.GetBytes("\r\n--" +
boundary + "--");
string formdataTemplate = "\r\n--" + boundary +
"\r\nContent-Disposition: form-data; name=\"{0}\";\r\n\r\n{1}";
if (formFields != null)
{
foreach (string key in formFields.Keys)
{
string formitem = string.Format(formdataTemplate, key, formFields[key]);
byte[] formitembytes = System.Text.Encoding.UTF8.GetBytes(formitem);
memStream.Write(formitembytes, 0, formitembytes.Length);
}
}
string headerTemplate =
"Content-Disposition: form-data; name=\"{0}\"; filename=\"{1}\"\r\n" +
"Content-Type: application/octet-stream\r\n\r\n";
for (int i = 0; i < files.Length; i++)
{
memStream.Write(boundarybytes, 0, boundarybytes.Length);
var header = string.Format(headerTemplate, "uplTheFile", files[i]);
var headerbytes = System.Text.Encoding.UTF8.GetBytes(header);
memStream.Write(headerbytes, 0, headerbytes.Length);
using (var fileStream = new FileStream(files[i], FileMode.Open, FileAccess.Read))
{
var buffer = new byte[1024];
var bytesRead = 0;
while ((bytesRead = fileStream.Read(buffer, 0, buffer.Length)) != 0)
{
Response.Write("bytesRead: " + bytesRead.ToString() + "<br>");
memStream.Write(buffer, 0, bytesRead);
}
}
}
memStream.Write(endBoundaryBytes, 0, endBoundaryBytes.Length);
request.ContentLength = memStream.Length;
using (Stream requestStream = request.GetRequestStream())
{
memStream.Position = 0;
byte[] tempBuffer = new byte[memStream.Length];
memStream.Read(tempBuffer, 0, tempBuffer.Length);
memStream.Close();
requestStream.Write(tempBuffer, 0, tempBuffer.Length);
}
try
{
using (var response = request.GetResponse())
{
Stream stream2 = response.GetResponseStream();
StreamReader reader2 = new StreamReader(stream2);
return reader2.ReadToEnd();
}
}
catch (Exception ex)
{
return (ex.ToString());
throw;
}
}
sp_change_users_login 'Auto_Fix', 'username'
sp_change_users_login [ @Action = ] 'action'
[ , [ @UserNamePattern = ] 'user' ]
[ , [ @LoginName = ] 'login' ]
[ , [ @Password = ] 'password' ]
[;]
[ @Action= ] 'action'
描述此程序所要執行的動作。 動作是varchar (10)。 通常是 'Auto_Fix'
[ @UserNamePattern= ] 'user'
這是目前資料庫中的使用者名稱。 使用者是sysname,預設值是 NULL。
[ @LoginName= ] 'login'
這是 SQL Server 登入的名稱。 登入是sysname,預設值是 NULL。
[ @Password= ] 'password'
指派給新的密碼SQL Server藉由指定建立登入Auto_Fix。 如果符合的登入已經存在,對應的使用者和登入和密碼會被忽略。 如果符合的登入不存在,則 sp_change_users_login 會建立新SQL Server登入,並指派密碼當做新登入的密碼。 密碼是sysname,而且不可以是 NULL。
$("#select").append($("<option></option>").attr("value", "值").text("文字"));