home
links
tips

code
users
tools
tutorials
projects
web
help
design

mudabone
suletzki
trans48
nutrition reality

MarthaAttire!

code


Enter your code snipets here. Try formating your code with something like this.

utils
A zip file containing my utils library of helper classes. Includes Tidy, Transform, HTTPS, etc.
C#
Pretty Print XML
Format your XML to look nice
C#
CleanXMLStryle Sheet to use to clean empty nodes/attributes out of XMLC#
Serialization of XMLThis code allows you to read/write XML and utilize it cleanly via classes instead of the
typical DOM nightmare.
C#
Simple Events
I have this mental block that prevents me from remembering how to do a simple
event in C# ... use this code if you're similiarly aflicted. :)
C#
SaveFormToINI
Saves a form and controls to an ini file...
C#
UDP/Sockets/Asynch
This class monitors an ip:port for a message and times out on in a input time period.
Had to do it for work and it was kind of tought to figure out so I thought I'd share.
C#
Simple TransformTransform some XML through some XSLTC#
SplitFor some reason they made it overly complicated to do a simple Split in .NET (C#)C#
stringToFileWrite a string to a fileC#
fileToStringGet a string from a fileC#
getRequest.NET freaks when you try to use a request item that doesn't exist... pain in the assC#
appPath

AppDomain.CurrentDomain.BaseDirectory;

or

System.IO.Path.GetDirectoryName(
System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase
).Replace(@"file:\","");

C#
cookieswrapper class for cookiesC#
fileUtilsa file util class C#
simple fileLog
private void fileLog(string message)
{
string p = System.IO.Path.GetDirectoryName(
System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase
).Replace(@"file:\","");
fileUtils f = new fileUtils();
f.stringToFile(System.IO.Path.Combine(p,"log" + Guid.NewGuid().ToString() + ".txt"),message);
}

configclass that allows you to easily read from an XML (config) file. To Do: add something that allows you to update it.C#
database olea class of DB (OLEDB) utilsC#
database sqla class of DB (SQL Server) utilsC#
text constantstext constants I frequently use (class)C#
RegXSome Regular Expression Utils (class)C#
Request VarsDebug Print Query/FormC#
open File DlgOpen file dialog code.C#
save File DlgSave file dialog code.C#
error to string
Simple function to convert an error message to string

convert bitmap to black and white
Converts bitmaps to 1 bit per pixel black and white bitmaps

vb asc
the vb asc function

vb chr
the vb chr function

ServerObjects
How to use Server object (Server, Request, Reponse) from class libraries
C#
force download of file
Response.ContentType = "application/octet-stream";
Response.AddHeader("Content-Disposition",
"attachment; filename=\"" + System.IO.Path.GetFileName(this.TextBox1.Text) + "\"");
Response.WriteFile(this.TextBox1.Text);


Windows Service
A simple windows service that wraps a class that has a timer in it. Also included: MSI install app for service.

MySQL and .NET
Tutorial on how to use MySQL with .NET

Random Numbers
private int RandomNumber(int min, int max)
{
Random random = new Random();
return random.Next(min, max);
}

Crop an Image
Bitmap fullImage = new Bitmap(fileSpec);
Rectangle rectangle = new Rectangle(0, (fullImage.Height / 4) * j, fullImage.Width, fullImage.Height / 4);
Bitmap cutVersion = fullImage.Clone(rectangle, fullImage.PixelFormat);
cutVersion.Save(desDir + fileNames[i] + "-" + j + ".png", ImageFormat.Png);
cutVersion.Dispose();
fullImage.Dispose();

Where (fullImage.Height / 4) * j is the height at which to make the crop
And (fullImage.Height / 4) is the total height that I want the final cropped image


Comments:

From wiseleyb [4.5.93.179] - 5/6/04 8:37 PM

The wiki is done in java and runs through a jetty server.  I think it's pretty much custom code at this point but am not 100% sure.  My brother will see this comment (the guy who runs/wrote editme)... so he might have more comments.

From oddible [207.21.167.10] - 5/6/04 8:03 PM

Perhaps EditMe could post the source code for this Wiki?
(or indicate the wiki used?)

Thanks.



Last Modified 4/26/05 9:04 AM

Hide Tools