Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Public Module CoreModule
- Dim R As New System.Random(CInt(Microsoft.VisualBasic.Timer))
- Public Function D(ByVal Roll As Integer) As Integer
- Return R.Next(0, Roll) + 1
- End Function
- Public Function _1D6() As Integer
- Return D(6)
- End Function
- Public Function _2D6() As Integer
- Return D(6) + D(6)
- End Function
- Public Function _3D6() As Integer
- Return D(6) + D(6) + D(6)
- End Function
- Public Function _4D6() As Integer
- Return D(6) + D(6) + D(6) + D(6)
- End Function
- Public Function CRLF() As String
- Return Microsoft.VisualBasic.ControlChars.CrLf
- End Function
- End Module
- Public NotInheritable Class CoreModule
- ' Methods
- Shared Sub New()
- Public Shared Function _1D6() As Integer
- Public Shared Function _2D6() As Integer
- Public Shared Function _3D6() As Integer
- Public Shared Function _4D6() As Integer
- Public Shared Function CRLF() As String
- Public Shared Function D(ByVal Roll As Integer) As Integer
- ' Fields
- Private Shared R As Random
- End Class
- public sealed class CoreModule
- {
- // Fields
- private static Random R;
- // Methods
- static CoreModule();
- public static int _1D6();
- public static int _2D6();
- public static int _3D6();
- public static int _4D6();
- public static string CRLF();
- public static int D(int Roll);
- }
- Imports System.Web
- Imports System.Web.UI
- Module ResponseHelper
- <System.Runtime.CompilerServices.Extension()> _
- Public Sub Redirect(ByVal response As Net.HttpWebResponse, _
- ByVal url As String, ByVal target As String, _
- ByVal windowFeatures As String)
- If String.IsNullOrEmpty(target) Or _
- target.Equals("_self", StringComparison.OrdinalIgnoreCase) And _
- String.IsNullOrEmpty(windowFeatures) Then
- response.Redirect(url, target, windowFeatures)
- Else
- Dim page As Page = CType(HttpContext.Current.Handler, Page)
- If page Is Nothing Then
- Throw New InvalidOperationException("Cannot redirect to new window outside Page context.")
- End If
- url = page.ResolveClientUrl(url)
- Dim script As String
- If String.IsNullOrEmpty(windowFeatures) Then
- script = "window.open(""{0}"", ""{1}"", ""{2}"";"
- Else
- script = "window.open(""{0}"", ""{1}"");"
- End If
- script = String.Format(script, url, target, windowFeatures)
- ScriptManager.RegisterStartupScript(page, GetType(Page), "Redirect", script, True)
- End If
- End Sub
- End Module
Add Comment
Please, Sign In to add comment