2021年12月21日 星期二

[.net] 檢查Server安裝.net 版本

 


檢查server上安裝的.net framework版本



cd C:\Windows\System32

dir %WINDIR%\Microsoft.Net\Framework\v* O-N /B




檢查server上安裝的.net core版本

dotnet --list-sdks




參考 https://docs.microsoft.com/zh-tw/dotnet/core/install/how-to-detect-installed-versions?pivots=os-windows



2021年9月1日 星期三

[MSSQL] 預存程序引用DLL參考



*在組件中加入DLL參考



*可將DLL檔案轉成bytes 直接加入參考



CREATE ASSEMBLY SQLCom

FROM 0x4D5A900003.................

WITH PERMISSION_SET = SAFE;



DLL to bytes string 參考

https://stackoverflow.com/questions/2885335/clr-sql-assembly-get-the-bytestream





 *DLL程式碼


    [Microsoft.SqlServer.Server.SqlFunction]

    public static string GZip(string rawString)

    {

       ..................

            return (string)(Convert.ToBase64String(zippedData));

    }








    * 於資料新增 擴充的 預存程序

    CREATE FUNCTION dbo.GZip(@src nvarchar(MAX))

    RETURNS nvarchar(MAX)

    EXTERNAL NAME SQLCom.UserDefinedFunctions.GZip





*SQL指令
    SELECT dbo.GZip(S_String)




2021年1月25日 星期一

[C#] 利用svcutil.exe下指令產生WCF client端的程式碼

 


在做異質系統間接時,若是透過WCF連線,此時專案就必須加入服務參考,但開發本機端若因為防火牆因素無法直接連到對方的WCF服務來取的服務參考,但目標機器又無法安裝VS2019開發工具,這時可在目標機器上安裝SDK,並利用svcutil.exe來下指令產生clinet端程式碼


以下兩道指令

svcutil.exe /t:metadata http://******/******/MsgService.svc

svcutil *.wsdl *.xsd /language:cs /out:MsgService.cs /config:app.config




 

MangoHost Copyright © 2009 Cookiez is Designed by Ipietoon for Free Blogger Template