小编Rya*_*Rya的帖子

TSQL - 设置多个变量的有效方法

他们是一个更有效的方式吗?

set @ShippingL = (select ShippingL from AuctionProducts where ProductID = @ProductID)
set @ShippingB = (select ShippingB from AuctionProducts where ProductID = @ProductID)
set @ShippingH = (select ShippingH from AuctionProducts where ProductID = @ProductID)
set @ShippingW = (select ShippingW from AuctionProducts where ProductID = @ProductID)
Run Code Online (Sandbox Code Playgroud)

干杯,-R

t-sql performance

9
推荐指数
1
解决办法
6083
查看次数

查看完整的网站,而不是iPhone上的移动版本

我有一个脚本,可以检测您是否是iPhone用户,并重定向到更友好的iPhone页面.

<script  type="text/javascript">
    if((navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i))) 
    {
        location.replace("http://domain.com/iphone/");
    }
</script> 
Run Code Online (Sandbox Code Playgroud)

这很好但有一个问题.通常,为用户提供查看完整网页的能力.但是,如果我链接到根,显然重定向将发送到移动版本!

关于如何点击链接的任何想法/iphone/,他们可以去/并留在那里.

javascript iphone redirect mobile-website

5
推荐指数
2
解决办法
8687
查看次数

TSQL选择逗号列表到行

如何在一行中输入逗号列表字段并将其显示在列中?

例如,

ID | Colour
------------
1  | 1,2,3,4,5
Run Code Online (Sandbox Code Playgroud)

至:

ID | Colour
------------
1  | 1 
1  | 2
1  | 3
1  | 4
1  | 5
Run Code Online (Sandbox Code Playgroud)

t-sql

5
推荐指数
1
解决办法
9246
查看次数

Powershell 计时器 - 更新 gui

我创建了一个 powershell 计时器,每 1 秒后,我想运行一个函数来执行或发布文本到界面上的文本框日志。

运行下面。当您单击开始时,每 1 秒,日志文本区域应显示“每 1 秒发布一次日志,而不是批量”。但是,当您单击“停止”时,这些消息只会一次性显示为一批。

这个问题网上好像没有答案!

代码:

$global:timer = New-Object System.Timers.Timer
$global:timer.Interval = 1000


function AddToLog($logtext)
{
    $txtLog.Text = $txtLog.Text + "`r`n" + $logtext
    $txtLog.ScrolltoCaret
}

function startTimer() { 
    Register-ObjectEvent -InputObject $global:timer -EventName Elapsed -SourceIdentifier theTimer -Action {AddToLog('Post to log every 1 second, not as a batch') }
    $global:timer.start()
    Write-Host "Start Timer"
}

function stopTimer() {
    $global:timer.stop()
    Write-Host "Close Function"
    Unregister-Event theTimer
}


########################
# Setup User Interface
########################

[void] [System.Reflection.Assembly]::LoadWithPartialName("System.Drawing") 
[void] [System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms") 

$objForm = …
Run Code Online (Sandbox Code Playgroud)

powershell user-interface timer

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