小编Joh*_*ohn的帖子

验证日期是否在当前日期之前

使用这个功能,我有7天的差异; 如何测试日期是否在当前日期之前?

function validateDate() {
    pickedDate = Date.parse("05-Jul-2012".replace(/-/g, " "));
    todaysDate = new Date();
    todaysDate.setHours(0, 0, 0, 0);
    dateDifference = Math.abs(Number(todaysDate) - pickedDate);
    //7 Days=604800000ms
    if (dateDifference > 604800000) {
        return false;
    } else {
        return true;
    }
}
Run Code Online (Sandbox Code Playgroud)

javascript date

23
推荐指数
4
解决办法
6万
查看次数

使用Ctrl +单击和Shift +单击选择多个HTML表行

演示

我想使用Windows ShiftCtrl键选择多行,例如Windows中的多个文件夹选择.

从所选行的表中我必须得到第一列(学生ID)并传递到服务器端C#并从数据库中删除这些记录.

我在javascript中编写了一个代码,但是类名未应用于<tr>on ShiftCtrl+ 左键单击.

HTML

<table id="tableStudent" border="1">
    <thead>
        <tr>
            <th>ID</th>
            <th>Name</th>
            <th>Class</th>
        </tr>
    </thead>
    <tbody>
        <tr onmousedown="RowClick(this,false);">
            <td>1</td>
            <td>John</td>
            <td>4th</td>
        </tr>
         <tr onmousedown="RowClick(this,false);">
            <td>2</td>
            <td>Jack</td>
            <td>5th</td>
        </tr>
         <tr onmousedown="RowClick(this,false);">
            <td>3</td>
            <td>Michel</td>
            <td>6th</td>
        </tr>
        <tr onmousedown="RowClick(this,false);">
            <td>4</td>
            <td>Mike</td>
            <td>7th</td>
        </tr>
        <tr onmousedown="RowClick(this,false);">
            <td>5</td>
            <td>Yke</td>
            <td>8th</td>
        </tr>
         <tr onmousedown="RowClick(this,false);">
            <td>6</td>
            <td>4ke</td>
            <td>9th</td>
        </tr>
        <tr onmousedown="RowClick(this,false);">
            <td>7</td>
            <td>7ke</td>
            <td>10th</td>
        </tr>
    </tbody>
</table>
Run Code Online (Sandbox Code Playgroud)

JavaScript的

var selectedrow;
function …
Run Code Online (Sandbox Code Playgroud)

html javascript web-applications web

15
推荐指数
3
解决办法
4万
查看次数

在html表格单元格上拖动

小提琴

$(document).live('mouseup', function () {
    flag = false;
});

var colIndex;
var lastRow;

$(document).on('mousedown', '.csstablelisttd', function (e) {
    //This line gets the index of the first clicked row.
    lastRow = $(this).closest("tr")[0].rowIndex;

    var rowIndex = $(this).closest("tr").index();
    colIndex = $(e.target).closest('td').index();
    $(".csstdhighlight").removeClass("csstdhighlight");
    if (colIndex == 0 || colIndex == 1) //)0 FOR FULL TIME CELL AND 1 FOR TIME SLOT CELL. 
    return;
    if ($('#contentPlaceHolderMain_tableAppointment tr').eq(rowIndex).find('td').eq(colIndex).hasClass('csstdred') == false) {
        $('#contentPlaceHolderMain_tableAppointment tr').eq(rowIndex).find('td').eq(colIndex).addClass('csstdhighlight');

        flag = true;
        return false;
    }
});
Run Code Online (Sandbox Code Playgroud)

我正在拖动表格单元格.在拖动(向下移动方向)时,我也必须移动表格滚动.而且我想选择反向(向上方向)的单元格.我该怎么办.

我在tr课上做了选择.

html javascript jquery web

13
推荐指数
1
解决办法
3277
查看次数

Sql查询获取名称列为null

Sql小提琴

CREATE TABLE [Users_Reg]
(
   [User_ID]        [int] IDENTITY (1, 1) NOT NULL CONSTRAINT User_Reg_P_KEY PRIMARY KEY,
   [Name]           [varchar] (50) NOT NULL, 
   [Type]           [varchar] (50) NOT NULL /*Technician/Radiologist*/
)

CREATE Table [Study]
(
  [UID]             [INT] IDENTITY (1,1) NOT NULL CONSTRAINT Patient_Study_P_KEY PRIMARY KEY,
  [Radiologist]     [int], /*user id of Radiologist type*/
  [Technician]      [int], /*user id of Technician type*/

)


select * from Study
inner join Users_Reg
on Users_Reg.User_ID=Study.Radiologist
Run Code Online (Sandbox Code Playgroud)

在patient_study表中,放射科医师或技师可能有0值.我如何从查询中获得技术员姓名和放射科医生姓名.

sql t-sql sql-server

8
推荐指数
1
解决办法
254
查看次数

密码保护时显示错误OpenXml Word文档在Office 2010中作为受密码保护的二进制Word重新保存

在Microsoft Word中,我创建了openxml.doc(*.docx)文件,将凭据'abc'作为Readpassword,将'xyz'作为WritePassword.

现在我必须将openxml.doc转换为binary.doc(WdSaveFormat = 0),使用下面的代码将文档作为Binary.doc成功创建

// Convert OpenXml.doc into binary.doc    
Convert(@"C:\Test\OpenXml.doc", @"C:\Test\binary.doc", WdSaveFormat.wdFormatDocument);

// Convert a Word .docx to Word 2003 .doc
public static void Convert(string input, string output, WdSaveFormat format)
{
    // Create an instance of Word.exe
    Word._Application oWord = new Word.Application();

    // Make this instance of word invisible (Can still see it in the taskmgr).
    oWord.Visible = false;

    // Interop requires objects.
    object oMissing = System.Reflection.Missing.Value;
    object isVisible = true;
    object readOnly = false;
    object oInput = input; …
Run Code Online (Sandbox Code Playgroud)

.net c# com ms-word office-interop

8
推荐指数
1
解决办法
286
查看次数

启用/禁用任务管理器

        public static void ToggleTaskManager(string keyValue)
        {
            RegistryKey objRegistryKey = Registry.CurrentUser.CreateSubKey("Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\System");
            objRegistryKey.SetValue("DisableTaskMgr", keyValue);
            objRegistryKey.Close();
        }


        private void btnDisableTaskManager_Click(object sender, EventArgs e)
        {
            ConsoleDisplay.ToggleTaskManager("1");
        }

        private void btnEnableTaskManager_Click(object sender, EventArgs e)
        {
            ConsoleDisplay.ToggleTaskManager("0");
        }
Run Code Online (Sandbox Code Playgroud)

对于上面使用的禁用/启用 TaskManager 功能,但是当我第一次禁用时,它会正确禁用。但是当我单击启用按钮时 TaskManager 未启用。

.net c# regedit

3
推荐指数
1
解决办法
1万
查看次数

在javascript中添加15分钟到字符串

var time="18:15:00"

我正在以24小时格式获得时间,如上面的字符串.我必须添加15分钟的时间我如何添加.不使用substring().

var time 字符串不是date object.在谷歌搜索但没有得到它.

javascript jquery

3
推荐指数
1
解决办法
7915
查看次数

在C#中使用多个分隔符拆分字符串

我无法在C#中拆分字符串以分隔符&&||.

例如,字符串可能如下所示:

"(abc)&&(rfd)&&(5)||(hh)&&(nn)||(iu)"
Run Code Online (Sandbox Code Playgroud)

码:

string[] value = arguments.Split(new string[] { "&&" }, StringSplitOptions.None);
Run Code Online (Sandbox Code Playgroud)

我需要在没有()大括号的数组中拆分或检索值- 我需要输出

"abc" "rfd" "5" "nn" "iu"
Run Code Online (Sandbox Code Playgroud)

我需要一个数组

Dictionary<string, string> dict = new Dictionary<string, string>();
            dict.Add("a", "value1");
            dict.Add("abc", "value2");
            dict.Add("5", "value3");
            dict.Add("rfd", "value4");
            dict.Add("nn", "value5");
            dict.Add("iu", "value6");

foreach (string s in strWithoutBrackets)
{
     foreach (string n in dict.Keys)
     {
          if (s == n)
          { 
               //if match then replace dictionary value with s
          }
      }
}

 ///Need output like this
 string outputStr …
Run Code Online (Sandbox Code Playgroud)

c#

3
推荐指数
1
解决办法
350
查看次数

单击按钮打开窗口作为模式对话框使用javascript

我必须使用javascript打开单击按钮的窗口作为模式对话框.我使用了window.open,但它显示了两个实例父页面以及弹出页面.当弹出页面打开时,不允许单击父页面.

function openWindow() {
  var w = 950;
  var h = 350;
  var t = 0;
  var l = 0;
  var scrollbars = 1;
  var modal = 'yes';

  var reportWindow = window.open("Search.aspx" + '', '', "width=" + w + ",height=" + h + ",left=" + l + ",top=" + t + ',scrollbars=' + scrollbars + 'modal' + modal);
  reportWindow.focus();
}
Run Code Online (Sandbox Code Playgroud)

html javascript asp.net

2
推荐指数
1
解决办法
2万
查看次数

字符串操作以从数组中排序消息

string[] array = new string[] { "12", "3$4", "5$67", "8$945", "$9484$", "$63$" };
foreach(string message in array)
{
    FindString(message);
}

string remainingString = "";
string tempString = "";
string outputString = "";
Run Code Online (Sandbox Code Playgroud)

这就是 FindString

private void FindString(string message)
{
    if(message.Contains("$"))
    {//remove char ^ process
         int pos = -1;
         pos = message.IndexOf('$');
         outputString = message.Substring(0, pos);
         remainingString = message.Substring(pos + 1);
         if(tempString != "")
         {
             outputString = tempString + outputString;
         objList.Add(outputString);
         tempString = "";
         }
         if(remainingString.Length != 0)
         {
             FindString(remainingString);
         //remainingString …
Run Code Online (Sandbox Code Playgroud)

.net c# string

0
推荐指数
1
解决办法
115
查看次数

选择TEXT列的MAX INT值

UserID    UserName  Password

1                abc               123
10               xyz               456
3                mno               254

SELECT MAX(UserId) AS UserId FROM UserLogin
Run Code Online (Sandbox Code Playgroud)

当我运行此查询时,它给了我3而不是10

所有列都是TEXT数据类型

sql oledb ms-access-2010

-2
推荐指数
2
解决办法
1万
查看次数