Skip to content

Instantly share code, notes, and snippets.

@mrlin0518
mrlin0518 / GridViewToDataTable.vb
Created January 13, 2020 11:00
將GridView資料轉成DataTable
''' <summary>
''' 將Gridview轉DataTable
''' </summary>
''' <param name="grid"></param>
''' <returns></returns>
Public Shared Function GetGridDataTable(ByVal grid As GridView) As DataTable
Dim dt As DataTable = New DataTable
Dim dc As DataColumn
Dim dr As DataRow
For i As Integer = 0 To grid.Columns.Count - 1
@mrlin0518
mrlin0518 / CheckDiffent.vb
Last active January 31, 2020 06:29
差異比對
''' <summary>
''' 比對資料
''' </summary>
''' <param name="DataTableA">比對資料A</param>
''' <param name="DataTableB">比對資料B</param>
''' <param name="colList">欄位名稱</param>
''' <param name="colName">資料名稱(欄位名稱(比對資料之欄位名稱),中文名稱(相對應的中文名稱))</param>
''' <returns name="dt">有差異的資料</returns>
Private Function DataCompar(ByRef DataTableA As DataTable, ByRef DataTableB As DataTable, ByRef colList As List(Of String), ByRef colName As Dictionary(Of String, String)) As DataTable
Dim dt As DataTable = createDataCol(colList)
@mrlin0518
mrlin0518 / Redis.java
Created January 24, 2019 10:30
簡易練習Redis
package util;
import redis.clients.jedis.Jedis;
public class Redis {
Jedis jedis = RedisConnction.jedis;
public boolean add(String key,String value) {
if(!jedis.exists(key)) {
@mrlin0518
mrlin0518 / AndroidToken.java
Created January 24, 2019 07:31
WebView與FCM練習
import android.webkit.JavascriptInterface;
import com.google.android.gms.tasks.OnSuccessListener;
import com.google.firebase.iid.FirebaseInstanceId;
import com.google.firebase.iid.InstanceIdResult;
public class AndroidToken extends Object {
private String deviceToken;
@JavascriptInterface
public String get() {
FirebaseInstanceId.getInstance().getInstanceId().addOnSuccessListener( new OnSuccessListener<InstanceIdResult>() {
@mrlin0518
mrlin0518 / FinedStock.jsp
Last active January 21, 2019 16:03
SpringTest
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@ page isELIgnored = "false" %>
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="https://unpkg.com/purecss@1.0.0/build/pure-min.css" />
</head>
<body style="padding: 40px" >
<div align="center">
@mrlin0518
mrlin0518 / MyForm.html
Last active August 15, 2018 08:35
Web課堂練習-2
<!DOCTYPE html>
<!--
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
-->
<html>
<head>
<title>MyForm</title>
<meta charset="UTF-8">
@mrlin0518
mrlin0518 / Login.java
Last active August 15, 2018 03:06
0809Web課堂練習
package model;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.Statement;
import java.util.ArrayList;
import java.util.List;
import vo.User;
@mrlin0518
mrlin0518 / S511.java
Created July 31, 2018 05:45
Web檔案上傳
package code.servlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.annotation.WebServlet;
import javax.servlet.annotation.MultipartConfig;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.ServletException;
import javax.servlet.RequestDispatcher;
import javax.servlet.http.Part;
package code.filter;
import javax.servlet.Filter;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.FilterChain;
import javax.servlet.ServletException;
import javax.servlet.FilterConfig;
import java.io.IOException;
package Employee;
public class DAOException extends Exception{
//建構子需要一個錯誤訊息字串
public DAOException(String message) {
super(message);
}
//建構子 錯誤訊息 原因