Please note, this is a STATIC archive of website www.tutorialspoint.com from 11 May 2019, cach3.com does not collect or store any user information, there is no "phishing" involved.
Tutorialspoint

Prodect /ProdectExtraTabsDetails/ProdectOptionDetails/ProductsSpecificationsDetails

USE [Ecommerce]
GO

/****** Object:  Table [dbo].[ProductsSpecificationsDetails]    Script Date: 4/12/2019 9:10:17 PM ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [dbo].[ProductsSpecificationsDetails](
	[Specificationsdetailsid] [int] NOT NULL,
	[Specificationsid] [varchar](50) NULL,
	[SpecificationsTax] [varchar](500) NULL,
	[Prodectid] [nvarchar](50) NULL,
 CONSTRAINT [PK_ProductsAttributeDetails] PRIMARY KEY CLUSTERED 
(
	[Specificationsdetailsid] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

SET ANSI_PADDING OFF
GO


++++++++++++++++++++++++++++++++




USE [Ecommerce]
GO

/****** Object:  Table [dbo].[ProdectOptionDetails]    Script Date: 4/12/2019 9:14:07 PM ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE TABLE [dbo].[ProdectOptionDetails](
	[ProdectOptionid] [int] IDENTITY(1,1) NOT NULL,
	[Prodectid] [int] NULL,
	[Optionsid] [int] NULL,
	[Optionname] [nvarchar](150) NULL,
	[Image] [nvarchar](50) NULL,
	[URL] [nvarchar](50) NULL,
 CONSTRAINT [PK_ProdectOptionDetails] PRIMARY KEY CLUSTERED 
(
	[ProdectOptionid] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]

GO


++++++++++++++


USE [Ecommerce]
GO

/****** Object:  Table [dbo].[ProdectImageDetails]    Script Date: 4/12/2019 9:14:29 PM ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [dbo].[ProdectImageDetails](
	[ProdectImageid] [int] IDENTITY(1,1) NOT NULL,
	[Prodectid] [int] NULL,
	[Image] [varchar](50) NULL,
	[SortOrder] [int] NULL,
 CONSTRAINT [PK_ProdectImageDetails] PRIMARY KEY CLUSTERED 
(
	[ProdectImageid] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

SET ANSI_PADDING OFF
GO


+++++++



USE [Ecommerce]
GO

/****** Object:  Table [dbo].[ProdectExtraTabsDetails]    Script Date: 4/12/2019 9:14:42 PM ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [dbo].[ProdectExtraTabsDetails](
	[ProdectExtraTabsid] [int] IDENTITY(1,1) NOT NULL,
	[ExtraTabsid] [int] NULL,
	[TabContent] [varchar](8000) NULL,
	[Prodectid] [int]] NULL,
 CONSTRAINT [PK_ProdectExtraTabsDetails] PRIMARY KEY CLUSTERED 
(
	[ProdectExtraTabsid] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

SET ANSI_PADDING OFF
GO

Hello World Program using VB.Net

Module VBModule
 
    Sub Main()
        Console.WriteLine("Hello World")
    End Sub
  
End Module

VB.net DateTime

Module dateNtime
   Sub Main()
      Console.WriteLine("India Wins Freedom: ")
      Dim independenceDay As New Date(1947, 8, 15, 0, 0, 0)
      ' Use format specifiers to control the date display.
      Console.WriteLine(" Format 'd:' " & independenceDay.ToString("d"))
      Console.WriteLine(" Format 'D:' " & independenceDay.ToString("D"))
      Console.WriteLine(" Format 't:' " & independenceDay.ToString("t"))
      Console.WriteLine(" Format 'T:' " & independenceDay.ToString("T"))
      Console.WriteLine(" Format 'f:' " & independenceDay.ToString("f"))
      Console.WriteLine(" Format 'F:' " & independenceDay.ToString("F"))
      Console.WriteLine(" Format 'g:' " & independenceDay.ToString("g"))
      Console.WriteLine(" Format 'G:' " & independenceDay.ToString("G"))
      Console.WriteLine(" Format 'M:' " & independenceDay.ToString("M"))
      Console.WriteLine(" Format 'R:' " & independenceDay.ToString("R"))
      Console.WriteLine(" Format 'y:' " & independenceDay.ToString("y"))
      Console.ReadKey()
   End Sub
End Module

VB.Net Class Definition. My filename: VB2.txt - Subs and Functions

'Name:  VB2, ID: 9DcLsk
'Date:  04/04/19
'https://www.tutorialspoint.com/compile_vb.net_online.php
 
module VBModule
 Class TestClass1           'Start of class
    'Public sub TC1_TestSub1()  'This works. What function does 'public' serve?
    sub TC1_TestSub1()          'This works
        Console.WriteLine("Hello, TestClass1: TC1_TestSub1")
    End sub
    Public sub TC1_TestSub2()
        Console.WriteLine("Hello, TestClass1: TC1_TestSub2")
    End sub'
 End Class
  Class TestClass2           'Start of class
    function TC2_TestSub1() as boolean         
        Console.Writeline("Hello, TestClass2: TC2_TestSub1")
        Return true
    End function
 End Class
'**********************************************
'Vars defined in Classes
    dim MyTest1 as TestClass1 = new TestClass1  '"NEW" is needed
    dim MyTest2 as TestClass2 = new TestClass2
'locals?
    dim Testflg1 as boolean         'Initial value nor defined, default = 0
    dim Testflg2 as boolean = true  'Initial value defined

 Sub Main()
    Console.WriteLine("Hello, world!" & environment.newline )
    Console.WriteLine("Hello, world_1!")
    Console.WriteLine("MyVar values: Testflg1: " & Testflg1)
    Console.WriteLine("MyVar values: Testflg2: " & Testflg2)
        
    MyTest1.TC1_TestSub1()
    MyTest1.TC1_TestSub2()
    Console.WriteLine("Hello, TestClass2: TC2_TestSub1() ret value is: " & MyTest2.TC2_TestSub1)
 End Sub
End module

code

Sub LoopFinal()
'This is the final loop that will generate a dish that meets all the criterias.

Dim row As Integer 'Variable that will be used for the FOR loop, representing the first row
Dim backEnd As Worksheet 'This variable represents the backEnd sheet, where the items meeting the client's specification will be stored.
Dim dietSheet As Worksheet 'dietSheet is a variable that represents the dietSheet sheet.
Dim cat As String 'This represents the catagory of the dish that is being iterated through the list.
Dim cal As Integer 'This represents the meal type of the dish that is being iterated through the list.
Dim typeMeal As String 'This represents the meal type of the dish that is being iterated through the list.
Dim catBool As Boolean 'Boolean that will return false if the client's calorie specification input is empty.
Dim mealBool As Boolean 'Boolean that will return false if the client's meal type specification input is empty.
Dim fillBool As Boolean 'Boolean that will return false if the client's fill level specification input is empty.
Dim catValue As String 'String variable that will represent the category specification that the client inputs.
Dim calValue As Integer 'Integer variable that will represent the calorie value specification that the client inputs.
Dim typeMealInput As String 'String variable that will represent the meal type specification that the client inputs.
Dim fillLevelInput As String 'String variable that will represent the fill level specification that the client inputs.
Dim fillLevel As String 'This variable represents the fill level of the dish that is being iterated through the list.
Dim protLevelInput As Integer 'Integer variable that will represent the protein amount specification inputted by the client.
Dim protLevel As Integer 'This variable represents the protein amount of the dish that is being iterated through the list.
Dim lastRow As Long 'Variable that will represent the last row where data is stored
Dim counter As Integer 'Variable that will represent the row the dish/food and it's specifications will be pasted in the backEnd

'Assigning variables to correct sheets
Set dietSheet = Sheet3
Set backEnd = Sheet4


lastRow = backEnd.Cells(Rows.Count, 1).End(xlUp).row 'Assigning last row to the variable
counter = 0 'Intializing the counter variable

If IsEmpty(dietSheet.Range("A6").Value) = False Then 'If the user input for the category specification is not empty.
    catBool = True
    catValue = dietSheet.Range("A6").Value 'CATINPUT will be assigned the user input
Else
    catBool = False
End If

If IsEmpty(dietSheet.Range("B6").Value) = False Then 'If the user input for the calorie specification is not empty.
    calValue = dietSheet.Range("B6").Value 'CALINPUT will be assigned the user input
Else
    calValue = 10000 'This is because if the client has no specification for a calorie value, it can therefore be large, and no calorie count of an eatable dish can exceed 10000.
End If

If IsEmpty(dietSheet.Range("C6").Value) = False Then 'If the user input for the meal type specification is not empty.
    mealBool = True
    typeMealInput = dietSheet.Range("C6").Value 'MEALTYPEINPUT will be assigned the user input
Else
    mealBool = False
End If


If IsEmpty(dietSheet.Range("D6").Value) = False Then 'If the user input for the fill level specification is not empty.
    fillBool = True
    fillLevelInput = dietSheet.Range("D6").Value 'FILLLEVELINPUT will be assigned the user input
Else
    fillBool = False
End If

If IsEmpty(dietSheet.Range("E6").Value) = False Then 'If the user input for the protein specification is not empty.
    protLevelInput = dietSheet.Range("E6").Value 'PROTEININPUT will be assigned the user input
Else
    protLevelInput = 10000 'This is because if the client has no specification for a protein value, it can therefore be large, and no protein count of an eatable dish can exceed 10000.
End If


For row = 1 To lastRow 'loop through entire item list table
    'Assigning the specification of the food being iterated through the table to variables
    cat = backEnd.Cells(row, 2).Value
    cal = backEnd.Cells(row, 3).Value
    typeMeal = backEnd.Cells(row, 4).Value
    fillLevel = backEnd.Cells(row, 5).Value
    protLevel = backEnd.Cells(row, 6).Value

        'These nested If's will determine the which methods to call based on the client inputted specifications and will call the PasteMeal method in order to paste the correct meals in the backEnd
        If catBool Then 'If CATINPUT = NOT Empty
            If mealBool Then
                If fillBool Then
                    If cat = catValue And cal <= calValue And typeMeal = typeMealInput And fillLevelInput = fillLevel And protLevel <= protLevelInput Then 'Runs if user inputs all specifications
                        Call pasteMeal(row, counter, backEnd) 'Call pasteMeal AND pass through ROW variable AND counter in order to paste the meal and specifications in backEnd
                        End If
                    
                    Else
                        If cat = catValue And cal <= calValue And typeMeal = typeMealInput And protLevel <= protLevelInput Then
                        Call pasteMeal(row, counter, backEnd)
                        End If
                   End If
            Else
                If fillBool Then
                    If cat = catValue And cal <= calValue And fillLevelInput = fillLevel And protLevel <= protLevelInput Then
                        Call pasteMeal(row, counter, backEnd)
                        End If
                    
                    Else
                        If cat = catValue And cal <= calValue And protLevel <= protLevelInput Then
                        Call pasteMeal(row, counter, backEnd)
                        End If
                   End If
            End If
        Else
            If mealBool Then
                If fillBool Then
                    If cal <= calValue And typeMeal = typeMealInput And fillLevelInput = fillLevel And protLevel <= protLevelInput Then
                        Call pasteMeal(row, counter, backEnd)
                        End If
                    
                    Else
                        If cal <= calValue And typeMeal = typeMealInput And protLevel <= protLevelInput Then
                        Call pasteMeal(row, counter, backEnd)
                        End If
                   End If
            Else
                If fillBool Then
                    If cal <= calValue And fillLevelInput = fillLevel And protLevel <= protLevelInput Then
                        Call pasteMeal(row, counter, backEnd)
                        End If
                    
                    Else
                        If cal <= calValue And protLevel <= protLevelInput Then
                        Call pasteMeal(row, counter, backEnd)
                        End If
                   End If
            End If
        End If
                        
Next row

'Ensures that the data is inserted in the correct location without any whitespace
If IsEmpty(backEnd.Range("H1")) = True Then
    backEnd.Rows(1).Delete
End If

End Sub
Sub pasteMeal(row As Integer, counter As Integer, backEnd As Worksheet)
'This method pastes the meal in the BACKEND table

    counter = counter + 1 'Update the counter when the method is called
    
    'Paste the meal that matches all the specifications inputted by the client
    backEnd.Select
    Range(Cells(row, 1), Cells(row, 7)).Select
    Selection.Copy
    Cells(counter, 8).Select
    Selection.PasteSpecial Paste:=xlPasteValues

End Sub
Sub DifferentMeal()
'This method will be used to provide alternative meals that meet the specifications if the client does not like the initial outputted meal.

Dim dietSheet As Worksheet 'dietSheet is a variable that represents the dietSheet sheet.
Dim backEnd As Worksheet 'This variable represents the backEnd sheet, where the items meeting the client's specification will be stored.
Dim lastRow As Integer 'Variable that will represent the last row of the table, in this method, it will illustrate the last row of the table in the BACKEND sheet.
Dim randomRow As Integer 'Variable that will store a random integer between 1 to lastRow, this will be used to randomly select a row in the table of foods that meet the client's specifications.

'Assigning the sheets to the correct variables
Set backEnd = Sheet4
Set dietSheet = Sheet3

'Assigning variables
lastRow = backEnd.Cells(Rows.Count, 8).End(xlUp).row
randomRow = WorksheetFunction.RandBetween(1, lastRow)


If IsEmpty(backEnd.Range("H1")) = True Then 'If table empty, it means no meal is found meeting the client's specifications
    MsgBox "No replacement meal found", vbInformation 'OUTPUT "No replacement meal found" through message box
Else
    'Copy food and it's specifications in randomRow and paste it in the dietSheet, where the food and it's specifications will be outputted
    backEnd.Select
    Cells(randomRow, 8).Select
    Selection.Copy
    dietSheet.Select
    Cells(11, 1).Select
    Selection.PasteSpecial Paste:=xlPasteValues
    
    backEnd.Select
    Range(Cells(randomRow, 9), (Cells(randomRow, 14))).Select
    Selection.Copy
    dietSheet.Select
    Cells(15, 1).Select
    Selection.PasteSpecial Paste:=xlPasteValues
    
    backEnd.Select
    Range((Cells(randomRow, 8)), Cells(randomRow, 14)).Select
    Selection.Delete
    dietSheet.Select


End If
End Sub
Sub MoreFoodLoopTable()
'This method will be used to find food that the client can eat (still meeting the calorie count) along with the outputted meal and paste it into the BACKEND2 sheet

Dim backEnd2 As Worksheet 'This variable represents the backEnd2 sheet, where a table containing food that the client can eat with the meal (still meeting the calorie count) will be stored.
Dim dietSheet As Worksheet 'dietSheet is a variable that represents the dietSheet sheet.
Dim listSheet As Worksheet 'This variable represents the listSheet, where the full list of all food items and their details are stored.
Dim wantedCal As Integer 'Variable representing the calorie specification of the client
Dim returnedCal As Integer 'Variable representing the calorie of the meal that has been outputted
Dim fullCal As Integer 'Variable representing the WANTEDCAL - RETURNEDCAL, highlighting the amount of calories left that the client can consume
Dim row As Integer 'Variable that will be used for the FOR loop, representing the first row of the table.
Dim counter As Integer 'Variable that will represent the row the dish/food and it's specifications will be pasted in the backEnd2 sheet
Dim foodName As String 'Name of the food/dish being iterated through
Dim cal As Integer 'Variable representing the calorie of the food being iterated through the table in the listSheet
Dim lastRow As Long 'Variable that will represent the last row of the table.

'Assigning sheets to the variables
Set backEnd2 = Sheet7
Set dietSheet = Sheet3
Set listSheet = Sheet2

'Assigning variables to values
wantedCal = dietSheet.Range("B6").Value
returnedCal = dietSheet.Range("B15").Value

fullCal = wantedCal - returnedCal 'Amount of calories left that the client can consume.
backEnd2.Range("A:B").Clear 'Clear the sheet in order to accept new data entry
lastRow = listSheet.Cells(Rows.Count, 1).End(xlUp).row 'Assigning lastRow
counter = 0 'Initialize the variable

 For row = 2 To lastRow 'Loop through the table of foods in the listSheet
    'Assigning variables
    cal = listSheet.Cells(row, 3).Value
    foodName = listSheet.Cells(row, 1).Value
    If cal <= fullCal Then 'If the calorie of the food being iterated through the table is less than the amount of calories the client can consume after the meal already outputted.
            counter = counter + 1 'Update counter
            'Copy dish and it's specifications meeting the calorie specification stated in the if statement
            listSheet.Select
            listSheet.Cells(row, 1).Select
            Selection.Copy
            
            'Paste it in the next available row in the BACKEND2 sheet
            backEnd2.Select
            backEnd2.Cells(counter, 1).Select
            Selection.PasteSpecial Paste:=xlPasteValues
            listSheet.Select
            listSheet.Cells(row, 3).Select
            Selection.Copy
            backEnd2.Select
            backEnd2.Cells(counter, 2).Select
            Selection.PasteSpecial Paste:=xlPasteValues
    End If
Next row
End Sub
Sub MoreNewFood()
'This method will be used to randomly output additional food/dish the client can eat, generated from the MoreFoodLoopTable

Dim dietSheet As Worksheet 'dietSheet is a variable that represents the dietSheet sheet.
Dim backEnd2 As Worksheet 'This variable represents the backEnd2 sheet, where a table containing food that the client can eat with the meal (still meeting the calorie count) will be stored.
Dim lastRow As Long 'Variable that will represent the last row of the table.
Dim randomRow As Integer 'Variable that will store a random integer between 1 to lastRow, this will be used to randomly select a row of food in the table in BACKEND2

'Assigning variables to the correct sheets
Set backEnd2 = Sheet7
Set dietSheet = Sheet3



'Assigning variables correct values
lastRow = backEnd2.Cells(Rows.Count, 1).End(xlUp).row
randomRow = WorksheetFunction.RandBetween(1, lastRow)

'Copy random meal from backEnd2 and output to the user in correct locarion
backEnd2.Select
Cells(randomRow, 1).Select
Selection.Copy
dietSheet.Select
Cells(18, 11).Select
Selection.PasteSpecial Paste:=xlPasteValues

backEnd2.Select
Cells(randomRow, 2).Select
Selection.Copy
dietSheet.Select
Cells(18, 12).Select
Selection.PasteSpecial Paste:=xlPasteValues


'Delete from table, because it has been outputted
backEnd2.Select
Range(Cells(randomRow, 1), Cells(randomRow, 2)).Select
Selection.Delete
dietSheet.Select

If IsEmpty(Range("L18")) = True Then 'If Table in BACKEND2 is empty Then
    MsgBox "No  meal found", vbInformation 'Output message box
End If


End Sub
Sub clearAllButton()
'Clear all in the trackVisual sheets to accept new graphs and tables.

Range("A:W").Clear
Worksheets("trackVisual").ChartObjects.Delete
End Sub

Answer 1

Module Module1
    Sub Main()
        Dim l1 As Integer = 1
        Reference(l1, 5)
        Console.WriteLine("Result=" & l1)
        l1=0
    End Sub
    Sub Reference(ByRef v1 As Integer, ByVal v2 As Integer)
        Do
            v1 = v2
        Loop Until 0 = 0
        Do While False
            v1 = v1 + v2
        Loop
    End Sub
End Module

test

'@Author :- Dinesh Kumar Version :- 1.0'

On Error Resume Next

Dim start_date

Dim end_date

Dim input_value

Dim hours

Dim minutes

Dim Total_time_spent

Dim septxt

Dim logPathname

Dim colon

Dim today_date

 Dim objFSO, strInput, objInput
 
 Dim arrValues, strItem, strLine
 
 Dim strOutput, objOutput
 
 Public total
 
 Dim NewLine
 
 Dim Total_message
 
 
 
 

 Const ForReading = 1
 
 Const ForWriting = 2
 
 Const Space = " "
 
 NewLine = "\n"
 
 Total_message = "TOTAL HOURS FOR"


Function convertTime(seconds)
   ConvSec = seconds Mod 60
   If Len(ConvSec) = 1 Then
         ConvSec = "0" & ConvSec
   End If
   ConvMin = (seconds Mod 3600) \ 60
   If Len(ConvMin) = 1 Then
         ConvMin = "0" & ConvMin
   End If
   ConvHour =  seconds \ 3600
   If Len(ConvHour) = 1 Then
         ConvHour = "0" & ConvHour
   End If
   convertTime = ConvHour & ":" & ConvMin & ":" & ConvSec
End Function


Function CSVParse(ByVal strLine)
    ' Function to parse comma delimited line and return array
    ' of field values.

    Dim arrFields
    Dim blnIgnore
    Dim intFieldCount
    Dim intCursor
    Dim intStart
    Dim strChar
    Dim strValue
	 
	
    Const QUOTE = """"
    Const QUOTE2 = """"""
	

    ' Check for empty string and return empty array.
    If (Len(Trim(strLine)) = 0) then
        CSVParse = Array()
        Exit Function
    End If

    ' Initialize.
    blnIgnore = False
    intFieldCount = 0
    intStart = 1
    arrFields = Array()

    ' Add "," to delimit the last field.
    strLine = strLine & ","

    ' Walk the string.
    For intCursor = 1 To Len(strLine)
        ' Get a character.
        strChar = Mid(strLine, intCursor, 1)
        Select Case strChar
            Case QUOTE
                ' Toggle the ignore flag.
                blnIgnore = Not blnIgnore
            Case ","
                If Not blnIgnore Then
                    ' Add element to the array.
                    ReDim Preserve arrFields(intFieldCount)
                    ' Makes sure the "field" has a non-zero length.
                    If (intCursor - intStart > 0) Then
                        ' Extract the field value.
                        strValue = Mid(strLine, intStart, _
                            intCursor - intStart)
                        ' If it's a quoted string, use Mid to
                        ' remove outer quotes and replace inner
                        ' doubled quotes with single.
                        If (Left(strValue, 1) = QUOTE) Then
                            arrFields(intFieldCount) = _
                                Replace(Mid(strValue, 2, _
                                Len(strValue) - 2), QUOTE2, QUOTE)
                        Else
                            arrFields(intFieldCount) = strValue
                        End If
                    Else
                        ' An empty field is an empty array element.
                        arrFields(intFieldCount) = Empty
                    End If
                    ' increment for next field.
                    intFieldCount = intFieldCount + 1
                    intStart = intCursor + 1
                End If
        End Select
    Next
    ' Return the array.
    CSVParse = arrFields
End Function


septxt = ", "

colon = ": "

today_date= FormatDateTime(Now(), vbShortDate)


logPathname = "C:\Dinesh\LOGFILE.csv"

input_value = Wscript.Arguments.Item(0)

Function FileObject()

Set objShell = CreateObject("WScript.Shell")
Set objEnv = objShell.Environment("USER")
Set objFSO = CreateObject("Scripting.FileSystemObject") 
Set objTextFile = objFSO.OpenTextFile (logPathname, ForAppending, True)

End Function

''''''''''''''''''''''''''''''''''''''' 
' User Name Section 
'''''''''''''''''''''''''''''''''''''''

set wsNetwork = createobject("WSCRIPT.Network") 
outUser=wsNetwork.UserName

If input_value = "UNLOCK" Then

objEnv("UNLOCK_TIME") = FormatDateTime(Now(), vbGeneralDate)

Total_time_spent = objEnv("Total_time_spent")

Wscript.Echo "Time Usage last login : " & Total_time_spent  

WScript.Quit

''''''''''''''''''''''''''''''''''''''' 
' LOCK Section 
'''''''''''''''''''''''''''''''''''''''

ElseIf input_value = "LOCK" Then

start_date = objEnv("UNLOCK_TIME")

end_date = FormatDateTime(Now(), vbGeneralDate)

Total_time_spent = convertTime(DateDiff("s",start_date,end_date))

objEnv("Total_time_spent") = Total_time_spent

Const ForAppending = 8


''''''''''''''''''''''''''''''''''''''' 
' output Section 
'''''''''''''''''''''''''''''''''''''''

'objTextFile.WriteLine( & start_date   & septxt   & end_date  & septxt  & outUser & septxt & Total_time_spent )

'objTextFile.WriteLine(FormatDateTime(Now(), vbGeneralDate) & septxt  & outUser & septxt & outComputer)

objTextFile.WriteLine(+ FormatDateTime(start_date,vbShortDate) + septxt  + FormatDateTime( start_date,vbShortTime)   + septxt   +FormatDateTime(end_date,vbShortTime)  + septxt  + outUser + septxt + Total_time_spent)

objTextFile.Close

WScript.Quit


ElseIf input_value = "FINAL_UNLOCK" Then

start_date = objEnv("UNLOCK_TIME")
 
 strInput = "c:\Dinesh\LOGFILE.csv"

 total = 0

 Set objFSO = CreateObject("Scripting.FileSystemObject")
 Set objInput = objFSO.OpenTextFile(strInput, ForReading)

 ' Open the output file for writing.
 Set objOutput = objFSO.OpenTextFile(strOutput, ForWriting, True)

 ' Read the file.
 Do Until objInput.AtEndOfStream
 strLine = objInput.ReadLine
 ' Skip blank lines.
 If (Trim(strLine) <> "") Then
 ' Parse the fields in the file.
 arrValues = CSVParse(strLine)
 ' Write the value in the third field to the output file.
  total = int(DateDiff("s","00:00:00",arrValues(4))) + total
 End If
 Loop
 
 
wscript.echo total

FileObject() 

 objTextFile.WriteLine ( +space  )
 
 objTextFile.Close

 FileObject()
  
 Wscript.echo (+ Total_message +  start_date + colon + convertTime(total))
 
 objTextFile.WriteLine ( + Total_message +  start_date + colon + convertTime(total) )
 
 objTextFile.Close
 
 FileObject()
 
 objTextFile.WriteLine ( +space )
 
 objTextFile.Close
 
 FileObject()
 
 objTextFile.WriteLine ( +space  )
 
 objTextFile.Close
 
 WScript.Quit
 
 ' Clean up.
 objInput.Close
 objOutput.Close

End If






Compile and Execute VB.Net Online

Module VBModule
 
    Sub Main()
        dim startx as integer = 1
        dim starty as integer = 1
        Console.WriteLine(Findpath(startx,starty))
    End Sub
    Function FindPath(byval x as integer, byval y as integer)
        if (x > 11 or y>11) Then
            return false
        End if
        if (x,y = "G") Then
            return true
        if (x,y = "x" or x,y = "#") Then
            return false
        Else
            'mark x,y as part of solution path
        End If
        if (FINDPATH(x,y+1) =true) Then
            return true
        Elseif (FINDPATH(x+1,y) = true) Then
            return true
        Elseif (FINDPATH(x,y-1) =true) Then
            return true
        Elseif (FINDPATH(x-1,y) =true) Then
            return true
        Else
            'unmark x,y as part of solution path
            return false
        End If
    End Function
End Module

Game code for Jenny

Imports System

Public Class Test
    Public Shared Sub Main()
        Dim randomNum as Integer, a as Integer = 0, b as Integer = 0, i as Integer
        Dim random as System.Random = new System.Random()
        Dim guess as String
        
        randomNum = 1222 'random.Next(1000, 9999)
        
        guess = Console.ReadLine()
        
        for i = 0 to 3
            a = a + If(guess.Chars(i).Equals(randomNum.ToString().Chars(i)), 1, 0)
            b = b + If(Not guess.Chars(i).Equals(randomNum.ToString().Chars(i)) And randomNum.ToString().IndexOf(guess.Chars(i)) > -1, 1, 0)
        next
        
        Console.WriteLine(guess)
        Console.WriteLine(randomNum)
        Console.WriteLine(a & "A")
        Console.WriteLine(b & "B")
    End Sub
End Class

help file

Imports System.Net.Mail
Public Class Form1
   Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
      ' Set the caption bar text of the form.   
      Me.Text = "tutorialspoint.com"
   End Sub

   Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
      Try
         Dim Smtp_Server As New SmtpClient
         Dim e_mail As New MailMessage()
         Smtp_Server.UseDefaultCredentials = False
         Smtp_Server.Credentials = New Net.NetworkCredential("[email protected]", "password")
         Smtp_Server.Port = 587
         Smtp_Server.EnableSsl = True
         Smtp_Server.Host = "smtp.gmail.com"

         e_mail = New MailMessage()
         e_mail.From = New MailAddress(txtFrom.Text)
         e_mail.To.Add(txtTo.Text)
         e_mail.Subject = "Email Sending"
         e_mail.IsBodyHtml = False
         e_mail.Body = txtMessage.Text
         Smtp_Server.Send(e_mail)
         MsgBox("Mail Sent")

      Catch error_t As Exception
         MsgBox(error_t.ToString)
      End Try
   End Sub

1 2 3 4 5 6 7 ... 38 Next
Advertisements
Loading...

We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy.