|
Direct Sales Notification Service by Sean Maxwell
WSJ Vol 03 Issue 09 - pg.31
Listing 1
private System.Xml.XmlDocument GetSalesFromService()
{
System.Xml.XmlDocument oSalesXml = new System.Xml.XmlDocument();
MyWebReference.DirectSales oDirSales = new MyWebReference.DirectSales();
oSalesXml.LoadXml(oDirSales.GetSales());
return oSalesXml;
}
Listing 2
public const UInt32 SND_ASYNC = 1;
public const UInt32 SND_MEMORY = 4;
public static void PlayWavResource(string wav)
{
// get the namespace
string strNameSpace=
System.Reflection.Assembly.GetExecutingAssembly().GetName().Name.ToString();
// get the resource into a stream
Stream str =
System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream
(strNameSpace +"."+ wav);
if ( str == null )
return;
// bring stream into a byte array
byte[] bStr = new Byte[str.Length];
str.Read(bStr, 0, (int)str.Length);
// play the resource
PlaySound(bStr, IntPtr.Zero, SND_ASYNC | SND_MEMORY);
|