This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Public Function TranslateToSQL(ByVal jSQL As String) As String | |
| If (Application.CurrentProject.ProjectType = acADP) Then | |
| ' Operators, constants, delimiters and wildcard characters | |
| jSQL = Replace$(jSQL, "#", "'") | |
| jSQL = Replace$(jSQL, """", "'") | |
| jSQL = Replace$(jSQL, "&", "+") | |
| jSQL = Replace$(jSQL, "?", "_") | |
| jSQL = Replace$(jSQL, "*", "%") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Private sub GetName() | |
| On Error GoTo err_mw | |
| Dim strName As String ' Name to be obtained | |
| strName = InputBox(Prompt:="What is your name?", _ | |
| Title:="Name", Default:="Name") ' Get the name and save it to strName | |
| If strName = Null Or strName = Nothing Then Exit Sub ' If the response is empty exit sub |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <IfModule mod_expires.c> | |
| ExpiresActive on | |
| # Your document html | |
| ExpiresByType text/html "access plus 0 seconds" | |
| # Media: images, video, audio | |
| ExpiresByType audio/ogg "access plus 1 month" | |
| ExpiresByType image/gif "access plus 1 month" | |
| ExpiresByType image/jpeg "access plus 1 month" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using System.Web.UI; | |
| public partial class CreateAMessage : Page | |
| { | |
| protected void Page_Load(object sender, EventArgs e) | |
| { | |
| //This page creates an example messagebox on load. | |
| CreateMessage("Hello world!"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| protected void TextBoxNullCatcher(object sender, EventArgs e) | |
| {//Code to makes sure all controls that are textboxes have at least a '1' value. | |
| if (sender is Control) | |
| { | |
| var usedControl = sender as Control; //Declare the control | |
| if (usedControl is TextBox) | |
| { | |
| TextBox txtType = usedControl as TextBox; //Set the control as a textbox | |
| if (string.IsNullOrEmpty(Convert.ToString(txtType.Text))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Private Sub CleanFormTextboxes() | |
| 'Empty textboxes in the current form | |
| 'Loop through the controls | |
| Dim ctrl As Control | |
| Dim txt As TextBox | |
| 'If a textbox is found in the loop and the text is more then 1 character, empty it | |
| For Each ctrl In Me.Controls | |
| If TypeOf ctrl Is TextBox Then |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using Microsoft.Office.Interop.Word; | |
| using Microsoft.VisualBasic; | |
| using System; | |
| using System.Drawing; | |
| using System.Drawing.Printing; | |
| using System.IO; | |
| using System.Text.RegularExpressions; | |
| using System.Windows.Forms; | |
| //Snippet of the Label-Printer-DYMO Project (https://github.com/Phuseos/Label-Printer-DYMO) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| protected void AddXMLToZIP(object Sender, EventArgs e) | |
| { | |
| string ZIPName = "TestZIP"; | |
| using (ZipFile zip = ZipFile.Create(MapPath + "ZIP" + ZIPName + ".zip")) | |
| { | |
| //Allow the zipfile to be updated | |
| zip.BeginUpdate(); | |
| //Set the folder on the server |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <%@ WebHandler Language="C#" Class="KeepSessionAlive" %> | |
| using System; | |
| using System.Web; | |
| using System.Web.SessionState; | |
| //Handler that checks the session, when called from the Master page (see below) it will keep the session from idle time-out. | |
| public class KeepSessionAlive : IHttpHandler, IRequiresSessionState | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System.Text.RegularExpressions; | |
| public static string spliceText(string text, int lineLength) | |
| { | |
| return Regex.Replace(text, "(.{" + lineLength + "})", "$1" + Environment.NewLine); | |
| } | |
| /* | |
| How to use |