Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Kamarudin k4m4r82

🏠
Working from home
View GitHub Profile
View vb_koneksi_sqlserver_menggunakan_user_windows.vb
Private Function GetOpenConnection() As SqlConnection
Dim conn As SqlConnection = Nothing
Try
' . = localhost
' sqlexpress2008 = instance sql server
' retail = nama database
Dim strConn = "Data Source=.\sqlexpress2008;Initial Catalog=Retail;Integrated Security=True"
conn = New SqlConnection(strConn)
View tes_akses_webservice.php
<?php
header('Content-Type: text/plain');
$wsdl = 'http://localhost/ServiceKoperasi/ServiceBarang.svc?wsdl';
$client = new SoapClient($wsdl);
$result = $client->GetAll();
foreach ($result->GetAllResult->Barang as $barang) {
View NumberTextWatcher.java
import java.text.DecimalFormat;
import java.text.ParseException;
import android.text.Editable;
import android.text.TextWatcher;
import android.widget.EditText;
public class NumberTextWatcher implements TextWatcher {
private DecimalFormat df;
View DemoNumberTextWatcher.java
// get edittext
EditText txtHargaVoucher = (EditText)findViewById(R.id.txtHargaVoucher);
// add text change listenr
txtHargaVoucher.addTextChangedListener(new NumberTextWatcher(txtHargaVoucher));
View bacaFileJson.java
private void bacaFileJson(String fileName) {
try {
InputStream inputStream = this.context.getAssets().open(fileName);
InputStreamReader streamReader = new InputStreamReader(inputStream);
BufferedReader reader = new BufferedReader(streamReader);
while (reader.ready()) {
String json = reader.readLine();
View DemoThousandSeparator.cs
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
txtThousandSeparator.TextAlign = HorizontalAlignment.Right;
View web.config
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.web>
<compilation debug="true" targetFramework="4.0" />
<customErrors mode="Off"/>
</system.web>
<system.webServer>
View USBSerialNumber.cs
// sumber : https://social.msdn.microsoft.com/Forums/en-US/923ccb2e-857e-429d-90ae-00f73e32eba4/getting-usb-flash-drive-serial-number-in-c?forum=wdk
// tambahkan namespace System.Management
public class USBSerialNumber
{
string _serialNumber;
string _driveLetter;
public string getSerialNumberFromDriveLetter(string driveLetter)
{
this._driveLetter = driveLetter.ToUpper();
@k4m4r82
k4m4r82 / DynamicInput.cs
Created May 7, 2015
Contoh Dynamic Input
View DynamicInput.cs
namespace DemoDynamicInput
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
Button[] btn = new Button[3];
View ParseYmsg
Private Sub ParseYmsg(Data As String)
On Error Resume Next
Dim PckTyp As Long, YChal() As String
PckTyp = (256 * Asc(Mid$(Data, 11, 1)) + Asc(Mid$(Data, 12, 1)))
Select Case PckTyp
Case Is = 6
Dim arrmsg() As String
You can’t perform that action at this time.