Inviare documenti direttamente alla stampante senza il dialog di stampa con php
Per applicazioni web intranet / locali potrebbe essere utile eliminare la conferma della stampa (dialog). Per fare ciò occorre abilitare php_printer.dll nelle ext.
avariato nasce vario, cresce e varia, e muore avariato. Soluzioni a problemi, nuovi spunti, news dal mondo informatico, ed attività varie ed eventuali.
"C:\Program Files\Microsoft Office\Office12\WINWORD.EXE" %1 /q /n /mFilePrintDefault /mFileExit
<?php
; Maximum allowed size for uploaded files.
upload_max_filesize = 8M
using System;
using System.Text;
namespace IPManager
{
class Program
{
static void Main(string[] args)
{
string cmd;
Console.WriteLine("^^^^^^^^^^^^PROG DI TEST PER IP^^^^^^^^^^^^");
Console.WriteLine("-> INSERISCI UN IP NEL FORMATO 192.168.1.1: ");
cmd = Console.ReadLine();
IPAddress ip = new IPAddress(cmd);
Console.WriteLine("-> HAI INSERITO: " + ip.ToString() + "");
Console.WriteLine("-> LO CONVERTO IN LONG: " + ip.Parse(ip.ToString()).ToString() + "");
Console.WriteLine("----------------------------------------");
Console.WriteLine("-> INSERISCI UN RANGE DI IP PER: " + ip.ToString() + "");
Console.WriteLine("-> DA: ");
cmd = Console.ReadLine();
IPAddress ipA = new IPAddress(cmd);
Console.WriteLine("-> A: ");
cmd = Console.ReadLine();
IPAddress ipB = new IPAddress(cmd);
if (ip.isInRange(ipA, ipB))
{
Console.WriteLine("-> " + ip.ToString() + " E' NEL RANGE!");
}
else
{
Console.WriteLine("-> " + ip.ToString() + ">NON< E' NEL RANGE!");
}
}
}
class IPAddress
{
private string ipStr;
public long NumericIPAddress
{
get { return ipNum; }
set { ipNum = value; }
}
private long ipNum;
public IPAddress(string ipAddress)
{
this.ipStr = ipAddress;
this.ipNum = this.Parse(ipAddress);
}
public long Parse(string ipAddress)
{
string[] arr;
arr = ipAddress.Split('.');
return (long.Parse(arr[0]) * 16777216) + (long.Parse(arr[1]) * 65536) + (long.Parse(arr[2]) * 256) + long.Parse(arr[3]);
}
public bool isInRange(IPAddress ipA, IPAddress ipB)
{
if ((ipA.ipNum <= this.ipNum) && (ipB.ipNum >= this.ipNum))
{
return true;
}
else
{
return false;
}
}
public override string ToString()
{
return ipStr;
}
}
}

versione trial 90 gg di Visual Studio 2008 Professional Edition e versione trial "up to" 120 gg di Windows Server 2008:
Va bene! Bah! Ho preso un Pack!$result = mysql_query ("happy php!
SELECT users.user, (users.administrator = 1) as administrator
FROM users
WHERE users.user = '".$userName."'
") OR die ("Errore
query CHECK ADMINISTRATOR USER
Dettagli:".mysql_error());
$admin = false;
if(mysql_num_rows($result) > 0)
{
while($row = mysql_fetch_assoc($result))
{
if($row["administrator"] == "1")
$admin = true;
}
}
mysql_free_result($result);
highlight_string$ldaphost = 'ldap://mioserver';Occhio! Ricordatevi di editare il file di configurazione del php e di decommentare la linea con l' LDAP.
$ldapport = 389; //di solito 389
$login = 'dominio\username';
$password = 'password';
$ldapconn = ldap_connect($ldaphost, $ldapport);
$ds=$ldapconn;
echo "CONNESSIONE: ".$ds."\n\n";
$bd = ldap_bind($ldapconn, $login, $password);
if($bd) echo 'AUTENTICAZIONE RIUSCITA';
else echo 'AUTENTICAZIONE FALLITA!!!';
GEvent.addListener(marker, "click", function(){
var maxContentDiv = document.createElement('div');
maxContentDiv.innerHTML = 'Loading...';
marker.openInfoWindowHtml("Ottieni maggiori info cliccando sul tasto in alto a destra.",
{maxContent:maxContentDiv, maxTitle:"More info"});
var iw = map.getInfoWindow();
GEvent.addListener(iw, "maximizeclick", function(){GDownloadUrl("loadinfo.htm",function(data, responseCode){
if(responseCode != 200)
{
alert('O_o');
}
else
{
maxContentDiv.innerHTML = data;
}
});
});
});

public Configuratore(string file)
{
if (HttpContext.Current.Cache[file] == null)
{
//se la cache è vuota allora la riempio:
string conf = "TI METTO IN CACHE";
HttpContext.Current.Cache.Insert(file, conf, new System.Web.Caching.CacheDependency(file));
}
else
{
string conf = (string) HttpContext.Current.Cache[file];
}
//XmlTextReader xmlReader = new XmlTextReader(MapPath("pippo.xml"));
//while (xmlReader.Read()) {
// topolino.Text += xmlReader.NodeType;
// topolino.Text += " -> ";
// topolino.Text += xmlReader.Name;
// topolino.Text += " -> ";
// topolino.Text += xmlReader.Value;
// topolino.Text += "
";
//}
INSERT INTO nome_tabella_destinazioneBuona giornata :)
(nome_campo_uno, nome_campo_due, nome_campo_tre)
SELECT nome_campo_sorgente_uno, nome_campo_sorgente_due, nome_campo_sorgente_tre
FROM nome_tabella_sorgente
WHERE nome_campo_sorgente_uno > 10;