我想在某个日期添加日子.我有这样的代码:
DateTime endDate = Convert.ToDateTime(this.txtStartDate.Text);
Int64 addedDays = Convert.ToInt64(txtDaysSupp.Text);
endDate.AddDays(addedDays);
DateTime end = endDate;
this.txtEndDate.Text = end.ToShortDateString();
Run Code Online (Sandbox Code Playgroud)
但是这段代码没有用,几天都没有添加!我正在做的那个愚蠢的错误是什么?
我想得到URL的所有路径,除了url的当前页面,例如:我的URL是http://www.MyIpAddress.com/red/green/default.aspx我想得到" http:// www.仅限MyIpAddress.com/red/green/.我怎么能得到.我在做什么
string sPath = new Uri(HttpContext.Current.Request.Url.AbsoluteUri).OriginalString; System.Web.HttpContext.Current.Request.Url.AbsolutePath;
sPath = sPath.Replace("http://", "");
System.IO.FileInfo oInfo = new System.IO.FileInfo(sPath);
string sRet = oInfo.Name;
Response.Write(sPath.Replace(sRet, ""));
Run Code Online (Sandbox Code Playgroud)
它在新的System.IO.FileInfo(sPath)上显示异常,因为sPath包含"localhost/red/green/default.aspx",表示"不支持给定路径的格式".
我希望根据某些字段获得不同的记录.我正在使用以下方法:
string[] TobeDistinct = { "PKID" };
DataTable dtDistinct = GetDistinctRecords(ds.Tables[0], TobeDistinct);
DataSet ds2 = new System.Data.DataSet();
ds2.Tables.Add(dtDistinct);
public static DataTable GetDistinctRecords(DataTable dt, string[] Columns)
{
DataTable dtUniqRecords = new DataTable();
dtUniqRecords = dt.DefaultView.ToTable(true, Columns);
return dtUniqRecords;
}
Run Code Online (Sandbox Code Playgroud)
这给了我不同的记录,但只有两个记录.只会有两个不同的PKID.例如,我有PKID 10,12,14,16的多个记录,但结果是PKID 10和12的2行.更多的两行不存在,但应该在那里.我需要做什么?
我按照这篇文章:http://www.codeproject.com/Tips/153008/Select-DISTINCT-records-based-on-specified-fields

我正在将 PCA 应用于我的训练集,并希望使用 SVM 进行分类。如何在测试集中自动拥有相同的功能?(与 PCA 后的新列车集相同)。