分享很不錯的http 流程
轉至 : https://www.loggly.com/blog/http-status-code-diagram/
<?xml version="1.0" encoding="utf-8" ?> <nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.nlog-project.org/schemas/NLog.xsd NLog.xsd" autoReload="true" throwExceptions="false" internalLogLevel="Off" internalLogFile="c:\temp\nlog-internal.log"> <!-- optional, add some variables https://github.com/nlog/NLog/wiki/Configuration-file#variables --> <variable name="myvar" value="myvalue"/> <!-- See https://github.com/nlog/nlog/wiki/Configuration-file for information on customizing logging rules and outputs. --> <targets> <!-- add your targets here See https://github.com/nlog/NLog/wiki/Targets for possible targets. See https://github.com/nlog/NLog/wiki/Layout-Renderers for the possible layout renderers. --> <target xsi:type="File" name="f" fileName="${basedir}/logs/${shortdate}.log" layout="${longdate} ${uppercase:${level}} ${message}" /> </targets> <rules> <!-- add your logging rules here --> <logger name="*" minlevel="Trace" writeTo="f" /> <!-- Write all events with minimal level of Debug (So Debug, Info, Warn, Error and Fatal, but not Trace) to "f" <logger name="*" minlevel="Debug" writeTo="f" /> --> </rules> </nlog>
private static void WriteLog(string msg) { LogEventInfo ei = new LogEventInfo(NLog.LogLevel.Trace, "", ""); ei.Properties["Name"] = Guid.NewGuid(); ei.Properties["msg"] = msg; logger.Log(ei); }
<target xsi:type="File" name="f" fileName="${basedir}/logs/${shortdate}/${event-context:item=appName}.log" layout="${longdate} |${uppercase:${level}}| ${event-context:item=msg}" /> </targets>
await new BrowserFetcher().DownloadAsync(BrowserFetcher.DefaultRevision); using (var browser = await Puppeteer.LaunchAsync(new LaunchOptions() { Headless = true })) { //參考頁面 https://www.puppeteersharp.com/api/PuppeteerSharp.ScreenshotOptions.html using (var page = await browser.NewPageAsync()) { var loginPath = $"https://google.com"; await page.GoToAsync(loginPath); await page.EmulateMediaTypeAsync(PuppeteerSharp.Media.MediaType.Screen); //透過SetViewport控制視窗大小決定抓圖尺寸 await page.SetViewportAsync(new ViewPortOptions { Width = 1024, Height = 768 }); var outputFile = $"test.pdf"; await page.PdfAsync(outputFile, new PdfOptions() { PrintBackground = true, PreferCSSPageSize = true }); } }
| CODE | FK |
-----------------------
| A | 1,2,3 |
我需要轉如下才能關聯....| CODE | FK |
-----------------------
| A | 1 |
| A | 2 |
| A | 3 |
create FUNCTION [dbo].[Split](@String varchar(MAX), @Delimiter char(1))
returns @temptable TABLE (items varchar(MAX))
as
begin
declare @idx int
declare @slice varchar(8000)
select @idx = 1
if len(@String)<1 or @String is null return
while @idx!= 0
begin
set @idx = charindex(@Delimiter,@String)
if @idx!=0
set @slice = left(@String,@idx - 1)
else
set @slice = @String
if(len(@slice)>0)
insert into @temptable(Items) values(@slice)
set @String = right(@String,len(@String) - @idx)
if len(@String) = 0 break
end
return
end;