Posts

Showing posts from August, 2017

Advertisement.

TransHimalaya.in

Everest Helicopter Tour for a day

Book exciting packages at www.transhimalaya.in

ASP.Net VB Facebook SDK Post on User Wall or Any Page

Dim app_id AsString = "654674765764" Dim app_secret AsString = "dgfdgy465yfhy675" Dim scope AsString = "publish_actions, manage_pages, publish_pages, public_profile"
If Session("code") IsNothingThen             Response.Redirect(String.Format("https://graph.facebook.com/oauth/authorize?client_id={0}&redirect_uri={1}&scope={2}", app_id, Request.Url.AbsoluteUri, scope)) ExitSub EndIf Dim tokens AsNewDictionary(OfString, String)()

Dim url AsString = String.Format("https://graph.facebook.com/oauth/access_token?client_id={0}&redirect_uri={1}&scope={2}&code={3}&client_secret={4}", app_id, Request.Url.AbsoluteUri, scope, Session("code").ToString(), app_secret) 'Dim url = "https://graph.facebook.com/oauth/access_token?client_id=" & app_id & "&redirect_uri=" & Reque

True or Real Random Generator Class in VB.Net

Create a Class file as shown

Imports Microsoft.VisualBasic
Imports System.Collections.Generic
Imports System.Linq
Imports System.Text
Imports System.Threading.Tasks

Namespace vbRand
    Public Interface IRandomizer
        Function Generate(max As Integer) As Integer
    End Interface

    Public Class RealRandom
        Implements IRandomizer
        Public Function Generate(max As Integer) As Integer Implements IRandomizer.Generate
            Return (New Random()).[Next](0, max)
        End Function

        'Private Function IRandomizer_Generate(max As Integer) As Integer Implements IRandomizer.Generate
        '    Return 0
        'End Function

    End Class
End Namespace


Import this class to your code where you wanna generate unique random number.

Imports vbRand


Private Sub btnPost_Click(sender As Object, e As EventArgs) Handles btnPost.Click
        Dim Randomizer As IRandomizer = New RealRandom()
        divMsg.InnerHtml = Randomizer.Generate(100).ToString
    End Sub


Now you will get ran…

Google+ Followers