netsh int tcp set global ecn=disable
C:\Windows\Microsoft.NET\Framework\v4.0.30319\InstallUtil.exe C:\TESTWindowService\myWindowsService.exe
C:\Windows\Microsoft.NET\Framework\v4.0.30319\InstallUtil.exe /u C:\TESTWindowService\myWindowsService.exe
需要调用web.extent....
using System.Web.Script.Serialization;
JavaScriptSerializer json = new JavaScriptSerializer();
List<URL> urlList = new List<URL>();
json.Serialize(urlList);
public class URL
{
public int ID { get; set; }
public string AD { get; set; }
public int type { get; set; }
public DateTime date { get; set; }
public string time { get; set; }
public string url { get; set; }
public bool status { get; set; }
}
添加服务器引用
NextEVWebservice.WebService websvc = new NextEVWebservice.WebService();
JavaScriptSerializer json = new JavaScriptSerializer();
List<URL> urlList = json.Deserialize<List<URL>>(websvc.GetURL(adName));
SPSecurity.RunWithElevatedPrivileges(delegate()
{
using (SPSite spSite = new SPSite(siteConfig.NEXTEVPortalWebUrl))
{
using (SPWeb spWeb = spSite.OpenWeb())
{
SPList m_objList1 = spWeb.Lists["NextEV Contacts"];
SPQuery query = new SPQuery();
SPListItemCollection list = m_objList1.GetItems(query);
foreach (SPItem item in list)
{
//查
string name = item["Nickname"].ToString();
//改
spWeb.AllowUnsafeUpdates = true;
item["Nickname"] = "测试";
item.Update();
spWeb.AllowUnsafeUpdates = false;
//删
spWeb.AllowUnsafeUpdates = true;
item.Delete();
spWeb.AllowUnsafeUpdates = false;
break;
}
//增
SPList m_objList2 = spWeb.Lists["NextEV Contacts"];
SPItem spitem = m_objList2.AddItem();
spWeb.AllowUnsafeUpdates = true;
spitem["Nickname"] = "测试";
spitem.Update();
spWeb.AllowUnsafeUpdates = false;
}
}
});
private void Func()
{
System.Timers.Timer t = new System.Timers.Timer(40000); 毫秒
t.Elapsed += new System.Timers.ElapsedEventHandler(Timer_Click); //Timer_Click是到达时间的时候执行事件的函数
//t.Elapsed +=
new
ElapsedEventHandler((s, e) => OnTimedEvent(s, e, a));
t.AutoReset = true; //设置是执行一次(false)还是一直执行(true)
t.Enabled = true;
}
private void Timer_Click(Object sender, ElapsedEventArgs e)
{
((System.Timers.Timer)sender).Enabled = false; //有不是时间短触发两次的试试
}
BeginInvoke(new Action(() => { 创建或访问控件语句 }));
BeginInvoke(new Action(() =>
{
LetsShow Ls = new LetsShow(backUrl);
Ls.Show();
}));
private void button1_Click(object sender, EventArgs e)
{
System.Timers.Timer t = new System.Timers.Timer();
t.Elapsed += new System.Timers.ElapsedEventHandler(Timer_Click); //Timer_Click是到达时间的时候执行事件的函数
//t.Elapsed += new ElapsedEventHandler((s, e) => OnTimedEvent(s, e, a));
t.AutoReset = true; //设置是执行一次(false)还是一直执行(true)
t.Enabled = true;
}
private void Timer_Click(Object sender, ElapsedEventArgs e)
{
string sendString = null;//要发送的字符串
byte[] sendData = null;//要发送的字节数组
UdpClient client = null;
IPAddress remoteIP = IPAddress.Parse("192.168.1.102");
int remotePort = 11000;
IPEndPoint remotePoint = new IPEndPoint(remoteIP, remotePort);//实例化一个远程端点
sendString = textBox1.Text;
sendData = Encoding.Default.GetBytes(sendString);
client = new UdpClient();
client.Send(sendData, sendData.Length, remotePoint);//将数据发送到远程端点
client.Close();//关闭连接
}
{
Thread th = new Thread(new ThreadStart(rec));
th.Start();
}
public void rec()
{
UdpClient client = null;
string receiveString = null;
byte[] receiveData = null;
//实例化一个远程端点,IP和端口可以随意指定,等调用client.Receive(ref remotePoint)时会将该端点改成真正发送端端点
IPEndPoint remotePoint = new IPEndPoint(IPAddress.Parse("192.168.1.102"), 0);
while (true)
{
client = new UdpClient(11000);
receiveData = client.Receive(ref remotePoint);//接收数据
receiveString = Encoding.Default.GetString(receiveData);
textBox1.Text = receiveString;
client.Close();//关闭连接
}
}
/[^\d.]/g,'' 小数
var strstring = (str == null ? "null" : str);
return (strstring.length > len ? strstring.substring(0, len) + "..." : strstring);
}
<div class="item-title label">选中地址</div>
<div class="item-input">
<input type="text" id="area"/>
</div>
</div>
$("#area").cityPicker({
toolbarTemplate: '<header class="bar bar-nav">\
<button class="button button-link pull-right close-picker">确定</button>\
<h1 class="title">选择收货地址</h1>\
</header>'
});
});
FROM sys.dm_tran_locks
WHERE resource_type='OBJECT '
KILL 79
1.查询外键约束
select name
from sys.foreign_key_columns f join sys.objects o on f.constraint_object_id=o.object_id
where f.parent_object_id=object_id('tsb_User')
alter table tsb_User drop constraint Reftsb_Shop12
我的第一个触发器
USE [Luolai]
GO
/****** Object: Trigger [dbo].[tgr_User_insert] Script Date: 2017/1/6 17:45:31 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER trigger [dbo].[tgr_User_insert]
on [dbo].[tsb_Franchisee]
after insert --插入触发
as
begin
--if Update(tsb_Franchisee)
--定义变量
declare @UID varchar(36), @UserName varchar(36), @ULogin varchar(36),@FranchiseeID varchar(36),@Create_time datetime,@DataStatus varchar(16);
--在inserted表中查询已经插入记录信息
select @UID = FranchiseeCode, @UserName = FranchiseeName, @Create_time=Create_Time,@ULogin=FranchiseeCode,@FranchiseeID=FranchiseeID,@DataStatus=DataStatus from Inserted;
insert into tsb_User values(@UID,@UserName,'',@ULogin,'b148afbee2a478d307c7cef18c0ab954','','','','','','',@FranchiseeID,'','usertype.franchisee','',@DataStatus,'',@Create_time,'','');
end
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------
NetJsonjson转类
Newtonsoft.Json.JsonConvert.DeserializeObject<QueryParam>(RequertParams.ToString());
asp.NET .ashx文件使用server.mappath解决方法:
System.Web.HttpContext.Current.Server.MapPath
在类文件中使用:
System.Web.HttpServerUtility server = System.Web.HttpContext.Current.Server;
server.MapPath(...)
<input class="form-control ng-untouched ng-pristine ng-invalid" placeholder="" type="text" required=""value="" id="txtBeginDay" name="beginday" οnclick="WdatePicker({ dateFmt: 'yyyy-MM-dd', maxDate: '#F{$dp.$D(\'txtEndDay\')}' });"/>
<input class="form-control ng-untouched ng-pristine ng-invalid" placeholder="" type="text" value="" id="txtEndDay" name="endday" οnclick="WdatePicker({ dateFmt: 'yyyy-MM-dd', minDate: '#F{$dp.$D(\'txtBeginDay\')}' });" />