`
dengbaoleng
  • 浏览: 1135474 次
文章分类
社区版块
存档分类
最新评论

ASP.NET程序中常用的三十三种代码

 
阅读更多

1.打开新的窗口并传送参数:

  传送参数:

response.write("<script>window.open(’*.aspx?id="+this.DropDownList1.SelectIndex+"&id1="+...+"’)</script>")
  接收参数:

stringa=Request.QueryString("id");
stringb=Request.QueryString("id1");
  2.为按钮添加对话框

Button1.Attributes.Add("onclick","returnconfirm(’确认?’)");
button.attributes.add("onclick","if(confirm(’areyousure...?’)){returntrue;}else{returnfalse;}")
  3.删除表格选定记录

intintEmpID=(int)MyDataGrid.DataKeys[e.Item.ItemIndex];
stringdeleteCmd="DeletefromEmployeewhereemp_id="+intEmpID.ToString()
  4.删除表格记录警告

privatevoidDataGrid_ItemCreated(Objectsender,DataGridItemEventArgse)
{
 switch(e.Item.ItemType)
 {
  caseListItemType.Item:
  caseListItemType.AlternatingItem:
  caseListItemType.EditItem:
   TableCellmyTableCell;
   myTableCell=e.Item.Cells[14];
   LinkButtonmyDeleteButton;
   myDeleteButton=(LinkButton)myTableCell.Controls[0];
   myDeleteButton.Attributes.Add("onclick","returnconfirm(’您是否确定要删除这条信息’);");
   break;
  default:
   break;
 }

}
  5.点击表格行链接另一页

privatevoidgrdCustomer_ItemDataBound(objectsender,System.Web.UI.WebControls.DataGridItemEventArgse)
{
 //点击表格打开
 if(e.Item.ItemType==ListItemType.Item||e.Item.ItemType==ListItemType.AlternatingItem)
  e.Item.Attributes.Add("onclick","window.open(’Default.aspx?id="+e.Item.Cells[0].Text+"’);");
}
  双击表格连接到另一页

  在itemDataBind事件中

if(e.Item.ItemType==ListItemType.Item||e.Item.ItemType==ListItemType.AlternatingItem)
{
 stringorderItemID=e.item.cells[1].Text;
 ...
 e.item.Attributes.Add("ondblclick","location.href=’../ShippedGrid.aspx?id="+orderItemID+"’");
}
  双击表格打开新一页

if(e.Item.ItemType==ListItemType.Item||e.Item.ItemType==ListItemType.AlternatingItem)
{
 stringorderItemID=e.item.cells[1].Text;
 ...
 e.item.Attributes.Add("ondblclick","open(’../ShippedGrid.aspx?id="+orderItemID+"’)");
}

6.表格超连接列传递参数

<asp:HyperLinkColumnTarget="_blank"headertext="ID号"DataTextField="id"NavigateUrl="aaa.aspx?id=’
 <%#DataBinder.Eval(Container.DataItem,"数据字段1")%>’&name=’<%#DataBinder.Eval(Container.DataItem,"数据字段2")%>’/>
  7.表格点击改变颜色

if(e.Item.ItemType==ListItemType.Item||e.Item.ItemType==ListItemType.AlternatingItem)
{
 e.Item.Attributes.Add("onclick","this.style.backgroundColor=’#99cc00’;
   this.style.color=’buttontext’;this.style.cursor=’default’;");
}
  写在DataGrid的_ItemDataBound里

if(e.Item.ItemType==ListItemType.Item||e.Item.ItemType==ListItemType.AlternatingItem)
{
e.Item.Attributes.Add("onmouseover","this.style.backgroundColor=’#99cc00’;
   this.style.color=’buttontext’;this.style.cursor=’default’;");
e.Item.Attributes.Add("onmouseout","this.style.backgroundColor=’’;this.style.color=’’;");
}

  8.关于日期格式

  日期格式设定

DataFormatString="{0:yyyy-MM-dd}"
  我觉得应该在itembound事件中

e.items.cell["你的列"].text=DateTime.Parse(e.items.cell["你的列"].text.ToString("yyyy-MM-dd"))
  9.获取错误信息并到指定页面

  不要使用Response.Redirect,而应该使用Server.Transfer

  e.g

//inglobal.asax
protectedvoidApplication_Error(Objectsender,EventArgse){
if(Server.GetLastError()isHttpUnhandledException)
Server.Transfer("MyErrorPage.aspx");

//其余的非HttpUnhandledException异常交给ASP.NET自己处理就okay了:)
}
  Redirect会导致post-back的产生从而丢失了错误信息,所以页面导向应该直接在服务器端执行,这样就可以在错误处理页面得到出错信息并进行相应的处理

  10.清空Cookie

Cookie.Expires=[DateTime];
Response.Cookies("UserName").Expires=0
  11.自定义异常处理

//自定义异常处理类
usingSystem;
usingSystem.Diagnostics;

namespaceMyAppException
{
 ///<summary>
 ///从系统异常类ApplicationException继承的应用程序异常处理类。
 ///自动将异常内容记录到WindowsNT/2000的应用程序日志
 ///</summary>
 publicclassAppException:System.ApplicationException
 {
  publicAppException()
  {
   if(ApplicationConfiguration.EventLogEnabled)LogEvent("出现一个未知错误。");
  }

 publicAppException(stringmessage)
 {
  LogEvent(message);
 }

 publicAppException(stringmessage,ExceptioninnerException)
 {
  LogEvent(message);
  if(innerException!=null)
  {
   LogEvent(innerException.Message);
  }
 }

 //日志记录类
 usingSystem;
 usingSystem.Configuration;
 usingSystem.Diagnostics;
 usingSystem.IO;
 usingSystem.Text;
 usingSystem.Threading;

 namespaceMyEventLog
 {
  ///<summary>
  ///事件日志记录类,提供事件日志记录支持
  ///<remarks>
  ///定义了4个日志记录方法(error,warning,info,trace)
  ///</remarks>
  ///</summary>
  publicclassApplicationLog
  {
   ///<summary>
   ///将错误信息记录到Win2000/NT事件日志中
   ///<paramname="message">需要记录的文本信息</param>
   ///</summary>
   publicstaticvoidWriteError(Stringmessage)
   {
    WriteLog(TraceLevel.Error,message);
   }

   ///<summary>
   ///将警告信息记录到Win2000/NT事件日志中
   ///<paramname="message">需要记录的文本信息</param>
   ///</summary>
   publicstaticvoidWriteWarning(Stringmessage)
   {
    WriteLog(TraceLevel.Warning,message);  
   }

   ///<summary>
   ///将提示信息记录到Win2000/NT事件日志中
   ///<paramname="message">需要记录的文本信息</param>
   ///</summary>
   publicstaticvoidWriteInfo(Stringmessage)
   {
    WriteLog(TraceLevel.Info,message);
   }
   ///<summary>
   ///将跟踪信息记录到Win2000/NT事件日志中
   ///<paramname="message">需要记录的文本信息</param>
   ///</summary>
   publicstaticvoidWriteTrace(Stringmessage)
   {
    WriteLog(TraceLevel.Verbose,message);
   }

   ///<summary>
   ///格式化记录到事件日志的文本信息格式
   ///<paramname="ex">需要格式化的异常对象</param>
   ///<paramname="catchInfo">异常信息标题字符串.</param>
   ///<retvalue>
   ///<para>格式后的异常信息字符串,包括异常内容和跟踪堆栈.</para>
   ///</retvalue>
   ///</summary>
   publicstaticStringFormatException(Exceptionex,StringcatchInfo)
   {
    StringBuilderstrBuilder=newStringBuilder();
    if(catchInfo!=String.Empty)
    {
     strBuilder.Append(catchInfo).Append("/r/n");
    }
    strBuilder.Append(ex.Message).Append("/r/n").Append(ex.StackTrace);
    returnstrBuilder.ToString();
   }

   ///<summary>
   ///实际事件日志写入方法
   ///<paramname="level">要记录信息的级别(error,warning,info,trace).</param>
   ///<paramname="messageText">要记录的文本.</param>
   ///</summary>
   privatestaticvoidWriteLog(TraceLevellevel,StringmessageText)
   {
    try
    {
     EventLogEntryTypeLogEntryType;
     switch(level)
     {
      caseTraceLevel.Error:
       LogEntryType=EventLogEntryType.Error;
       break;
      caseTraceLevel.Warning:
       LogEntryType=EventLogEntryType.Warning;
       break;
      caseTraceLevel.Info:
       LogEntryType=EventLogEntryType.Information;
       break;
      caseTraceLevel.Verbose:
       LogEntryType=EventLogEntryType.SuccessAudit;
       break;
      default:
       LogEntryType=EventLogEntryType.SuccessAudit;
       break;
     }

     EventLogeventLog=newEventLog("Application",ApplicationConfiguration.EventLogMachineName,ApplicationConfiguration.EventLogSourceName);
     //写入事件日志
     eventLog.WriteEntry(messageText,LogEntryType);

    }
   catch{}//忽略任何异常
  }
 }//classApplicationLog
}
12.Panel横向滚动,纵向自动扩展

<asp:panelstyle="overflow-x:scroll;overflow-y:auto;"></asp:panel>
  13.回车转换成Tab

<scriptlanguage="javascript"for="document"event="onkeydown">
 if(event.keyCode==13&&event.srcElement.type!=’button’&&event.srcElement.type!=’submit’&&    event.srcElement.type!=’reset’&&event.srcElement.type!=’’&&event.srcElement.type!=’textarea’);
   event.keyCode=9;
</script>

onkeydown="if(event.keyCode==13)event.keyCode=9"

  14.DataGrid超级连接列

DataNavigateUrlField="字段名"DataNavigateUrlFormatString="[url]http://xx/inc/del[/url]ete.aspx?ID={0}"
  15.DataGrid行随鼠标变色

privatevoidDGzf_ItemDataBound(objectsender,System.Web.UI.WebControls.DataGridItemEventArgse)
{
 if(e.Item.ItemType!=ListItemType.Header)
 {
  e.Item.Attributes.Add("onmouseout","this.style.backgroundColor=/""+e.Item.Style["BACKGROUND-COLOR"]+"/"");
  e.Item.Attributes.Add("onmouseover","this.style.backgroundColor=/""+"#EFF3F7"+"/"");
 }
}
  16.模板列

<ASP:TEMPLATECOLUMNvisible="False"sortexpression="demo"headertext="ID">
<ITEMTEMPLATE>
<ASP:LABELtext=’<%#DataBinder.Eval(Container.DataItem,"ArticleID")%>’runat="server"width="80%"id="lblColumn"/>
</ITEMTEMPLATE>
</ASP:TEMPLATECOLUMN>

<ASP:TEMPLATECOLUMNheadertext="选中">
<HEADERSTYLEwrap="False"horizontalalign="Center"></HEADERSTYLE>
<ITEMTEMPLATE>
<ASP:CHECKBOXid="chkExport"runat="server"/>
</ITEMTEMPLATE>
<EDITITEMTEMPLATE>
<ASP:CHECKBOXid="chkExportON"runat="server"enabled="true"/>
</EDITITEMTEMPLATE>
</ASP:TEMPLATECOLUMN>
  后台代码

protectedvoidCheckAll_CheckedChanged(objectsender,System.EventArgse)
{
 //改变列的选定,实现全选或全不选。
 CheckBoxchkExport;
 if(CheckAll.Checked)
 {
  foreach(DataGridItemoDataGridIteminMyDataGrid.Items)
  {
   chkExport=(CheckBox)oDataGridItem.FindControl("chkExport");
   chkExport.Checked=true;
  }
 }
 else
 {
  foreach(DataGridItemoDataGridIteminMyDataGrid.Items)
  {
   chkExport=(CheckBox)oDataGridItem.FindControl("chkExport");
   chkExport.Checked=false;
  }
 }
}
  17.数字格式化

  【<%#Container.DataItem("price")%>的结果是500.0000,怎样格式化为500.00?】

<%#Container.DataItem("price","{0:¥#,##0.00}")%>

inti=123456;
strings=i.ToString("###,###.00");
18.日期格式化

  【aspx页面内:<%#DataBinder.Eval(Container.DataItem,"Company_Ureg_Date")%>

  显示为:2004-8-1119:44:28

  我只想要:2004-8-11】

<%#DataBinder.Eval(Container.DataItem,"Company_Ureg_Date","{0:yyyy-M-d}")%>
  应该如何改?

  【格式化日期】

  取出来,一般是object((DateTime)objectFromDB).ToString("yyyy-MM-dd");

  【日期的验证表达式】

  A.以下正确的输入格式:[2004-2-29],[2004-02-2910:29:39pm],[2004/12/31]

^((/d{2}(([02468][048])|([13579][26]))[/-///s]?((((0?[13578])|(1[02]))[/-///s]?((0?[1-9])|([1-2][0-9])|(3[01])))|(((0?[469])|(11))[/-///s]?((0?[1-9])|([1-2][0-9])|(30)))|(0?2[/-///s]?((0?[1-9])|([1-2][0-9])))))|(/d{2}(([02468][1235679])|([13579][01345789]))[/-///s]?((((0?[13578])|(1[02]))[/-///s]?((0?[1-9])|([1-2][0-9])|(3[01])))|(((0?[469])|(11))[/-///s]?((0?[1-9])|([1-2][0-9])|(30)))|(0?2[/-///s]?((0?[1-9])|(1[0-9])|(2[0-8]))))))(/s(((0?[1-9])|(1[0-2]))/:([0-5][0-9])((/s)|(/:([0-5][0-9])/s))([AM|PM|am|pm]{2,2})))?$
  B.以下正确的输入格式:[0001-12-31],[99990930],[2002/03/03]

^/d{4}[/-///s]?((((0[13578])|(1[02]))[/-///s]?(([0-2][0-9])|(3[01])))|(((0[469])|(11))[/-///s]?(([0-2][0-9])|(30)))|(02[/-///s]?[0-2][0-9]))$
  【大小写转换】

HttpUtility.HtmlEncode(string);
HttpUtility.HtmlDecode(string)
  19.如何设定全局变量

  Global.asax中

  Application_Start()事件中

  添加Application[属性名]=xxx;

  就是你的全局变量

  20.怎样作到HyperLinkColumn生成的连接后,点击连接,打开新窗口?

  HyperLinkColumn有个属性Target,将器值设置成"_blank"即可.(Target="_blank")

  【ASPNETMENU】点击菜单项弹出新窗口

  在你的menuData.xml文件的菜单项中加入URLTarget="_blank",如:

<?xmlversion="1.0"encoding="GB2312"?>
<MenuDataImagesBaseURL="images/">
<MenuGroup>
<MenuItemLabel="内参信息"URL="Infomation.aspx">
<MenuGroupID="BBC">
<MenuItemLabel="公告信息"URL="Infomation.aspx"URLTarget="_blank"LeftIcon="file.gif"/>
<MenuItemLabel="编制信息简报"URL="NewInfo.aspx"LeftIcon="file.gif"/>
......
  最好将你的aspnetmenu升级到1.2版

  21.读取DataGrid控件TextBox值

foreach(DataGriddgiinyourDataGrid.Items)
{
 TextBoxtb=(TextBox)dgi.FindControl("yourTextBoxId");
 tb.Text....
}
  23.在DataGrid中有3个模板列包含Textbox分别为DG_ShuLiang(数量)DG_DanJian(单价)DG_JinE(金额)分别在5.6.7列,要求在录入数量及单价的时候自动算出金额即:数量*单价=金额还要求录入时限制为数值型.我如何用客户端脚本实现这个功能?

  〖思归〗

<asp:TemplateColumnHeaderText="数量">
<ItemTemplate>
<asp:TextBoxid="ShuLiang"runat=’server’Text=’<%#DataBinder.Eval(Container.DataItem,"DG_ShuLiang")%>’
onkeyup="javascript:DoCal()"
/>

<asp:RegularExpressionValidatorid="revS"runat="server"ControlToValidate="ShuLiang"ErrorMessage="mustbeinteger"ValidationExpression="^/d+$"/>
</ItemTemplate>
</asp:TemplateColumn>

<asp:TemplateColumnHeaderText="单价">
<ItemTemplate>
<asp:TextBoxid="DanJian"runat=’server’Text=’<%#DataBinder.Eval(Container.DataItem,"DG_DanJian")%>’
onkeyup="javascript:DoCal()"
/>

<asp:RegularExpressionValidatorid="revS2"runat="server"ControlToValidate="DanJian"ErrorMessage="mustbenumeric"ValidationExpression="^/d+(/./d*)?$"/>

</ItemTemplate>
</asp:TemplateColumn>

<asp:TemplateColumnHeaderText="金额">
<ItemTemplate>
<asp:TextBoxid="JinE"runat=’server’Text=’<%#DataBinder.Eval(Container.DataItem,"DG_JinE")%>’/>
</ItemTemplate>
</asp:TemplateColumn><scriptlanguage="javascript">
functionDoCal()
{
 vare=event.srcElement;
 varrow=e.parentNode.parentNode;
 vartxts=row.all.tags("INPUT");
 if(!txts.length||txts.length<3)
  return;

 varq=txts[txts.length-3].value;
 varp=txts[txts.length-2].value;

 if(isNaN(q)||isNaN(p))
  return;

 q=parseInt(q);
 p=parseFloat(p);

 txts[txts.length-1].value=(q*p).toFixed(2);
}
</script>

24.datagrid选定比较底下的行时,为什么总是刷新一下,然后就滚动到了最上面,刚才选定的行因屏幕的关系就看不到了。

page_load
page.smartNavigation=true
  25.在Datagrid中修改数据,当点击编辑键时,数据出现在文本框中,怎么控制文本框的大小?

privatevoidDataGrid1_ItemDataBound(objsender,DataGridItemEventArgse)
{
 for(inti=0;i<e.Item.Cells.Count-1;i++)
  if(e.Item.ItemType==ListItemType.EditType)
  {
   e.Item.Cells[i].Attributes.Add("Width","80px")
  }
}
  26.对话框

privatestaticstringScriptBegin="<scriptlanguage=/"JavaScript/">";
privatestaticstringScriptEnd="</script>";

publicstaticvoidConfirmMessageBox(stringPageTarget,stringContent)
{
 stringConfirmContent="varretValue=window.confirm(’"+Content+"’);"+"if(retValue){window.location=’"+PageTarget+"’;}";

 ConfirmContent=ScriptBegin+ConfirmContent+ScriptEnd;

 PageParameterPage=(Page)System.Web.HttpContext.Current.Handler;
 ParameterPage.RegisterStartupScript("confirm",ConfirmContent);
 //Response.Write(strScript);
}
  27.将时间格式化:stringaa=DateTime.Now.ToString("yyyy年MM月dd日");

  1.1取当前年月日时分秒

currentTime=System.DateTime.Now;
  1.2取当前年

int年=DateTime.Now.Year;
  1.3取当前月

int月=DateTime.Now.Month;
  1.4取当前日

int日=DateTime.Now.Day;
  1.5取当前时

int时=DateTime.Now.Hour;
  1.6取当前分

int分=DateTime.Now.Minute;
  1.7取当前秒

int秒=DateTime.Now.Second;
  1.8取当前毫秒

int毫秒=DateTime.Now.Millisecond;
  28.自定义分页代码:

  先定义变量:

publicstaticintpageCount;//总页面数
publicstaticintcurPageIndex=1;//当前页面
  下一页:

if(DataGrid1.CurrentPageIndex<(DataGrid1.PageCount-1))
{
 DataGrid1.CurrentPageIndex+=1;
 curPageIndex+=1;
}

bind();//DataGrid1数据绑定函数
  上一页:

if(DataGrid1.CurrentPageIndex>0)
{
 DataGrid1.CurrentPageIndex+=1;
 curPageIndex-=1;
}

bind();//DataGrid1数据绑定函数
  直接页面跳转:

inta=int.Parse(JumpPage.Value.Trim());//JumpPage.Value.Trim()为跳转值

if(a<DataGrid1.PageCount)
{
 this.DataGrid1.CurrentPageIndex=a;
}

bind();
29.DataGrid使用:

  添加删除确认:

privatevoidDataGrid1_ItemCreated(objectsender,System.Web.UI.WebControls.DataGridItemEventArgse)
{
 foreach(DataGridItemdiinthis.DataGrid1.Items)
 {
  if(di.ItemType==ListItemType.Item||di.ItemType==ListItemType.AlternatingItem)
  {
   ((LinkButton)di.Cells[8].Controls[0]).Attributes.Add("onclick","returnconfirm(’确认删除此项吗?’);");
  }
 }
}
  样式交替:

ListItemTypeitemType=e.Item.ItemType;

if(itemType==ListItemType.Item)
{
 e.Item.Attributes["onmouseout"]="javascript:this.style.backgroundColor=’#FFFFFF’;";
 e.Item.Attributes["onmouseover"]="javascript:this.style.backgroundColor=’#d9ece1’;cursor=’hand’;";
}
elseif(itemType==ListItemType.AlternatingItem)
{
 e.Item.Attributes["onmouseout"]="javascript:this.style.backgroundColor=’#a0d7c4’;";
 e.Item.Attributes["onmouseover"]="javascript:this.style.backgroundColor=’#d9ece1’;cursor=’hand’;";
}
  添加一个编号列:

DataTabledt=c.ExecuteRtnTableForAccess(sqltxt);//执行sql返回的DataTable
DataColumndc=dt.Columns.Add("number",System.Type.GetType("System.String"));

for(inti=0;i<dt.Rows.Count;i++)
{
 dt.Rows[i]["number"]=(i+1).ToString();
}

DataGrid1.DataSource=dt;
DataGrid1.DataBind();
  DataGrid1中添加一个CheckBox,页面中添加一个全选框

privatevoidCheckBox2_CheckedChanged(objectsender,System.EventArgse)
{
 foreach(DataGridItemthisiteminDataGrid1.Items)
 {
  ((CheckBox)thisitem.Cells[0].Controls[1]).Checked=CheckBox2.Checked;
 }
}
  将当前页面中DataGrid1显示的数据全部删除

foreach(DataGridItemthisiteminDataGrid1.Items)
{
 if(((CheckBox)thisitem.Cells[0].Controls[1]).Checked)
 {
  stringstrloginid=DataGrid1.DataKeys[thisitem.ItemIndex].ToString();
  Del(strloginid);//删除函数
 }
}
  30.当文件在不同目录下,需要获取数据库连接字符串(如果连接字符串放在Web.config,然后在Global.asax中初始化)

  在Application_Start中添加以下代码:

Application["ConnStr"]=this.Context.Request.PhysicalApplicationPath+ConfigurationSettings.
   AppSettings["ConnStr"].ToString();
  31.变量.ToString()

  字符型转换转为字符串

12345.ToString("n");//生成12,345.00
12345.ToString("C");//生成¥12,345.00
12345.ToString("e");//生成1.234500e+004
12345.ToString("f4");//生成12345.0000
12345.ToString("x");//生成3039(16进制)
12345.ToString("p");//生成1,234,500.00%
  32、变量.Substring(参数1,参数2);

  截取字串的一部分,参数1为左起始位数,参数2为截取几位。如:strings1=str.Substring(0,2);

  33.在自己的网站上登陆其他网站:(如果你的页面是通过嵌套方式的话,因为一个页面只能有一个FORM,这时可以导向另外一个页面再提交登陆信息)

<SCRIPTlanguage="javascript">
<!--
 functiongook(pws)
 {
  frm.submit();
 }
//-->

</SCRIPT><bodyleftMargin="0"topMargin="0"onload="javascript:gook()"marginwidth="0"marginheight="0">
<formname="frm"action="[url]http://220.194.55.68:6080/login.php?retid=7259[/url]"method="post">
<tr>
<td>
<inputid="f_user"type="hidden"size="1"name="f_user"runat="server">
<inputid="f_domain"type="hidden"size="1"name="f_domain"runat="server">
<inputclass="box"id="f_pass"type="hidden"size="1"name="pwshow"runat="server">

<INPUTid="lng"type="hidden"maxLength="20"size="1"value="5"name="lng">
<INPUTid="tem"type="hidden"size="1"value="2"name="tem">

</td>

</tr>

</form>
  文本框的名称必须是你要登陆的网页上的名称,如果源码不行可以用vsniffer看看。

  下面是获取用户输入的登陆信息的代码:

stringname;
name=Request.QueryString["EmailName"];

try
{
 inta=name.IndexOf("@",0,name.Length);
 f_user.Value=name.Substring(0,a);
 f_domain.Value=name.Substring(a+1,name.Length-(a+1));
 f_pass.Value=Request.QueryString["Psw"];
}

catch
{
 Script.Alert("错误的邮箱!");
 Server.Transfer("index.aspx");
}

分享到:
评论

相关推荐

    ASP.NET 程序中常用的三十三种代码

    ASP.NET 程序中常用的三十三种代码

    ASP.NET程序中常用的三十三种代码.doc

    ASP.NET程序中常用的三十三种代码 列举了常见的三十三种ASP.NET程序中代码,非常使用哦!

    ASP.NET程序中常用代码

    ASP.NET程序中常用代码ASP.NET程序中常用代码ASP.NET程序中常用代码ASP.NET程序中常用代码

    2层设计-2.4G RF高频信号收发模块硬件(cadence原理图+PADS PCB图+BOM)文件.zip

    2层设计-2.4G RF高频信号收发模块硬件(cadence原理图+PADS PCB图+BOM)文件,可供学习及设计参考。

    JAVA文件传输(lw+源代码).zip

    FTP(File Transfer Protocol)是文件传输协议的简称。 FTP的主要作用,就是让用户连接上一个远程计算机(这些计算机上运行着FTP服务器程序)查看远程计算机有哪些文件,然后把文件从远程计算机上拷到本地计算机,或把本地计算机的文件送到远程计算机去。 目前FTP服务器软件都为国外作品,例如Server_U、IIS,国内成熟的FTP服务器软件很少,有一些如(Crob FTP Server),但从功能上看来远不能和那些流行的服务器软件媲美。

    语音端点检测及其在Matlab中的实现.zip

    语音端点检测及其在Matlab中的实现.zip

    Matlab 交互式多模型目标跟踪IMM.zip

    Matlab 交互式多模型目标跟踪IMM.zip

    numpy试题(2021年整理精品文档).zip

    numpynumpy试题(2021年整理精品文档).zip

    基于Python+Django城市PM2.5空气质量数据可视化分析系统

    【作品名称】:基于Python+Django城市PM2.5空气质量数据可视化分析系统 【适用人群】:适用于希望学习不同技术领域的小白或进阶学习者。可作为毕设项目、课程设计、大作业、工程实训或初期项目立项。 【项目介绍】: Python基于Django城市PM2.5空气质量数据可视化分析 开发软件:Pycharm + Python3.7 + Django + Echarts + Mysql 实现目标:利用已经收集各个城市包括北京、上海、广州、成都、沈阳的PM2.5空气数据,利用python进行各种数据分析,将分析结果保存到csv文件中,然后利用django框架的网站,前端采用echart对分析的结果进行图表可视化展示。

    c#实现求解白拉修斯方程。程序使用文件流,四阶龙哥库塔法.zip

    c#实现求解白拉修斯方程。程序使用文件流,四阶龙哥库塔法

    单片机3.DSN

    单片机3.DSN

    NumPy 的用途是什么

    NumPy 的用途是什么

    Java游戏设计打飞机程序(源代码+LW).zip

    Java游戏设计打飞机程序(源代码+LW)Java游戏设计打飞机程序(源代码+LW)Java游戏设计打飞机程序(源代码+LW)Java游戏设计打飞机程序(源代码+LW)Java游戏设计打飞机程序(源代码+LW)Java游戏设计打飞机程序(源代码+LW)Java游戏设计打飞机程序(源代码+LW)Java游戏设计打飞机程序(源代码+LW)Java游戏设计打飞机程序(源代码+LW)Java游戏设计打飞机程序(源代码+LW)Java游戏设计打飞机程序(源代码+LW)Java游戏设计打飞机程序(源代码+LW)Java游戏设计打飞机程序(源代码+LW)Java游戏设计打飞机程序(源代码+LW)Java游戏设计打飞机程序(源代码+LW)Java游戏设计打飞机程序(源代码+LW)Java游戏设计打飞机程序(源代码+LW)Java游戏设计打飞机程序(源代码+LW)Java游戏设计打飞机程序(源代码+LW)Java游戏设计打飞机程序(源代码+LW)Java游戏设计打飞机程序(源代码+LW)

    Java项目之企业人事工资管理系统(源码)

    Java项目之企业人事工资管理系统(源码) 开发语言:Java 框架:ssm 技术:JSP JDK版本:JDK1.8 服务器:tomcat7 数据库:mysql 5.7(一定要5.7版本) 数据库工具:Navicat11 开发软件:eclipse/myeclipse/idea Maven包:Maven3.3.9

    vb.net做的教务管理系统 功能完善 后台数据库使用的acce.zip

    vb.net做的教务管理系统 功能完善 后台数据库使用的acce.zip

    Nvidia 17.1 for win10&Win11 vGPU驱动

    Nvidia 17.1最新win10&Win11 vGPU驱动 名称:551.78_grid_win10_win11_server2022_dch_64bit_internationa

    基于物品的协同过滤推荐调用实例(C#版).zip

    协同过滤算法(Collaborative Filtering)是一种经典的推荐算法,其基本原理是“协同大家的反馈、评价和意见,一起对海量的信息进行过滤,从中筛选出用户可能感兴趣的信息”。它主要依赖于用户和物品之间的行为关系进行推荐。 协同过滤算法主要分为两类: 基于物品的协同过滤算法:给用户推荐与他之前喜欢的物品相似的物品。 基于用户的协同过滤算法:给用户推荐与他兴趣相似的用户喜欢的物品。 协同过滤算法的优点包括: 无需事先对商品或用户进行分类或标注,适用于各种类型的数据。 算法简单易懂,容易实现和部署。 推荐结果准确性较高,能够为用户提供个性化的推荐服务。 然而,协同过滤算法也存在一些缺点: 对数据量和数据质量要求较高,需要大量的历史数据和较高的数据质量。 容易受到“冷启动”问题的影响,即对新用户或新商品的推荐效果较差。 存在“同质化”问题,即推荐结果容易出现重复或相似的情况。 协同过滤算法在多个场景中有广泛的应用,如电商推荐系统、社交网络推荐和视频推荐系统等。在这些场景中,协同过滤算法可以根据用户的历史行为数据,推荐与用户兴趣相似的商品、用户或内容,从而提高用户的购买转化率、活跃度和社交体验。 未来,协同过滤算法的发展方向可能是结合其他推荐算法形成混合推荐系统,以充分发挥各算法的优势。

    (文章复现)工业园区需求响应资源聚合优化配置方法matlab代码

    参考文献: [1]李明轩,齐步洋,贺大玮.工业园区需求响应资源聚合优化配置方法[J].电网技术,2022,46(09):3543-3549.DOI:10.13335/j.1000-3673.pst.2021.1666. 1.摘要 需求响应资源数量的不断提升对响应资源的优化运行方法提出了更高的要求。面向工业园区内负荷聚合商开展日内需求响应的应用场景,提出了一种资源聚合优化配置方法,即在日前时段对响应资源预先聚合优化形成一定数量满足 特定条件的聚合体,再在日内运行时段对各聚合体进行优化调用以满足电网侧需求。该方法实现对数量庞大、分散存在、特性各异的资源的灵活聚合和优化配置,充分发挥各资源响应潜力和互补特性,并通过将大量求解计算从日内转移至日前时段,平衡了响应实时性要求与计算规模的矛盾。通过算例分析验证了所提模型与方法的合理性和有效性。

    毕业设计[主机域名]HostDirector v1.01_hostdirector101.zip

    毕业设计[主机域名]HostDirector v1.01_hostdirector101.zip

Global site tag (gtag.js) - Google Analytics