Has anyone experience with Windows 10 LTSB - long term service branch - the branch that seems to be meant for businesses to install?
Thanks!
Steve
Thanks!
Steve
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If TextBox1.Text > TextBox2.Text Then
TextBox1.Text = CalculateAge(Format(TextBox2.Text, "dd/MM/yyyy"), Format(TextBox1.Text, "dd/MM/yyyy"))
Else
TextBox3.Text = CalculateAge(TextBox1.Text, TextBox2.Text)
End If
End Sub
Function CalculateAge(ByVal vDate1 As Date, ByVal vdate2 As Date) As String
Dim vYears As Integer, vMonths As Integer, vDays As Integer
vMonths = DateDiff("m", vDate1, vdate2)
vDays = DateDiff("d", DateAdd("m", vMonths, vDate1), vdate2)
If vDays < 0 Then
vMonths = vMonths - 1
vDays = DateDiff("d", DateAdd("m", vMonths, vDate1), vdate2)
End If
vYears = vMonths \ 12
vMonths = vMonths Mod 12
CalculateAge = vYears & "Year " & "-" & vMonths & "Month " & "-" & vDays & "Day"
End Function
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
TextBox2.Text = DateTime.Now.Date
End Sub
End Class
Set wbk = xls.workbooks.Add("SomeTemplate.xltm")
Set wbk = xls.workbooks.Open("SomeExcelFile.xlsm")
DECLARE @UserName VARCHAR(100),
@Password VARCHAR(64),
@PasswordSalt VARBINARY(64),
@CustomerID INT,
@HashedPassword VARBINARY(64)
BEGIN
--@Params is passed to the SP as a string
SET @UserName = (SELECT [Data] FROM dbo.Split(@Params , '|') WHERE ID = 1)
SET @Password = (SELECT [Data] FROM dbo.Split(@Params , '|') WHERE ID = 2)
SET @CustomerID = (SELECT [Data] FROM dbo.Split(@Params , '|') WHERE ID = 3)
--Create a 64bit random salt to add to the password
--not to interested in checking for duplicate salting in the DB since it would be extremely rare and does not cause an issue anyway
SET @PasswordSalt = CRYPT_GEN_RANDOM(64)
--Hash the salted password to get a 64bit hash
SET @HashedPassword = HASHBYTES('SHA2_512', CONVERT(VARBINARY(100), @Password) + @PasswordSalt)
--Prevent duplicate usernames
IF (NOT EXISTS(SELECT [ID] FROM [dbo].[tblUser] WHERE [UserName] = @Username))
BEGIN
INSERT INTO [dbo].[tblUser]
([UserName], [PasswordHash], [PasswordSalt], [CustomerID])
VALUES
(@UserName, @HashedPassword, @PasswordSalt, @CustomerID)
END
ELSE
BEGIN
RETURN 2
END
Private Sub btnCreate_Click(sender As Object, e As EventArgs) Handles btnCreate.Click
If Not CheckForm() Then Exit Sub 'this just checks all the fields are filled in properly
'just a simple salting and hash on this side
Dim PasswordHash As String = Hash512(txtPassword.Text, txtUserName.Text)
Dim RetVal As Integer = 0
RetVal = UpdateRecords_WithStoredProcedureB("SP_Name", "ConString", "SP_VarName", SP_Params)
If RetVal = 0 Then
MessageBox.Show("Account Created")
Me.Close()
Else
MessageBox.Show("There was an error creating the account")
End If
End Sub
Public Function Hash512(password As String, salt As String) As String
Dim convertedToBytes As Byte() = Encoding.UTF8.GetBytes(password & salt)
Dim hashType As HashAlgorithm = New SHA512Managed()
Dim hashBytes As Byte() = hashType.ComputeHash(convertedToBytes)
Dim hashedResult As String = Convert.ToBase64String(hashBytes)
Return hashedResult
End Function
private void DrawText(TextBox txt, ComboBox cmb)
{
DataRowView drv = (DataRowView)cmb.Items[cmb.SelectedIndex];
if (string.IsNullOrEmpty(txt.Text))
{
txt.Text = cmb.GetItemText(cmb.SelectedItem) + " " + drv["NAME"].ToString();
}
else
{
txt.Text = txt.Text + " , " + cmb.GetItemText(cmb.SelectedItem) + " " + drv["NAME"].ToString();
}
}
private void Cmb_SelectionChangeCommitted(object sender, EventArgs e)
{
ComboBox cmb = (ComboBox)sender;
switch (cmb.Name)
{
case "Combobox1":
DrawText(Textbox1, cmb);
break;
//... and so on
}
}
Dim ExcelApp As Object
Dim ExcelBook As Object
Dim ExcelSheet As Object
Dim i As Integer
Dim j As Integer
Dim m As Integer
'create object of excel
ExcelApp = CreateObject("Excel.Application")
ExcelBook = ExcelApp.WorkBooks.Add
ExcelSheet = ExcelBook.WorkSheets(1)
ExcelSheet.visible = True
With ExcelSheet
'fill excel with values
For m = 0 To LST.Columns.Count - 2
.cells(1, m + 1) = LST.Columns(m).Text
Next
For i = 1 To LST.Items.Count - 2
If IsNumeric(LST.Items(i - 1).Text) Then
.cells(i + 1, 1) = String.Format("{0:n2}", Decimal.Parse(LST.Items(i - 1).Text))
.cells(i + 1, 1).NumberFormat = "0.00"
Else
.cells(i + 1, 1) = LST.Items(i - 1).Text
End If
For j = 1 To LST.Columns.Count - 2
If IsNumeric(LST.Items(i - 1).SubItems(j).Text) Then
' Check for the Code field, do not to print decimals
If j = 1 Then
.cells(i + 1, j + 1) = LST.Items(i - 1).SubItems(j).Text
Else
.cells(i + 1, j + 1) = String.Format("{0:n2}", Decimal.Parse(LST.Items(i - 1).SubItems(j).Text))
.cells(i + 1, j + 1).NumberFormat = "0.00"
End If
Else
.cells(i + 1, j + 1) = LST.Items(i - 1).SubItems(j).Text
End If
Next
Next
End With
Private Declare Sub RtlCopyMemory Lib "ntdll.dll" (ByRef Destination As Long, ByRef Source As Long, ByVal Length As Long)
Private Sub Form_Load()
Dim a As Long
Dim b As Long
a = 5
RtlCopyMemory b, a, 1
Print b
End Sub
Sub sveas_Workbook()
Application.WindowState = xlNormal
Windows("Master file.xlsx").Activate
ChDir "C\:Documents and Settings\New Folder\Saved files"
ActiveWorkbook.SaveAs Filename:= _
"C\:Documents and Settings\New Folder\Saved files\" & Range("BC20").Value & "\" & Range("BD26").Value & "\" & Range("C14").Value & "\" & Range("BC30").Value _
, FileFormat:=xlOpenXMLWorkbook, CreateBackup:=False
ActiveWindow.Close
End Sub
Range("BC20").Value & "\" & Range("BD26").Value & "\" & Range("C14").Value & "\" & Range("BC30").Value
Private Sub dgvGamesList_CellClick(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles dgvGamesList.CellClick
I = dgvGamesList.CurrentRow.Index
'...... READ DATA FROM THIS ROW
'...........
End Sub
Private Sub dgvGamesList_RowEnter(sender As Object, e As DataGridViewCellEventArgs) Handles dgvGamesList.RowEnter
I = dgvGamesList.CurrentRow.Index
'...... READ DATA FROM THIS ROW
'...........
End Sub
if {Consumption_Branch;1.CLASSIFICATION}="CHILLED" then
if {Consumption_Branch;1.Vatable}=True then
global numbervar GTotal:=GTotal + Sum ({Consumption_Branch;1.TOTALCOST}, {Consumption_Branch;1.UOM})/1.12
else
global numbervar GTotal:=GTotal + Sum ({Consumption_Branch;1.TOTALCOST}, {Consumption_Branch;1.UOM})
Public Sub FillHistoryGrid(ByRef TempmyVar)
If condition = true Then
Dim myVar As New List(Of Type5)
Else
Dim myVar As New List(Of Type6)
End If
myVar = TempmyVar
...
end sub