|
Will anyone please help me in starting windows service. Can we run a windows service into a network drive?Is the network path accessible via service? I have written a code on windows service using c#.net.It takes the screenshot every 5seconds.It works well in my computer and saves the screenshot in the given path.But when I give the path to save the .jpeg file taken as a screenshot within the network,its shows the exception "A generic error occurred in GDI+." Can there be a solution for this exception? Thank u. If code is also required then the main part to take screenshot is below:
int screenWidth = Screen.GetBounds(new Point(0, 0)).Width; int screenHeight = Screen.GetBounds(new Point(0, 0)).Height; Bitmap bmp = new Bitmap(screenWidth, screenHeight, PixelFormat.Format32bppArgb); Graphics gfx = Graphics.FromImage((Image)bmp); gfx.CopyFromScreen(0, 0, 0, 0, new Size(screenWidth, screenHeight)); string filename = @"\\202.79.41.205\common\path\" + Environment.MachineName + "--" + getipaddress() + "--" + DateTime.Now.ToString().Replace(":", "").Replace(@"/", "") + ".jpeg"; bmp.Save(filename); bmp.Dispose(); gfx.Dispose();
This post has been edited by prabhat003: 22 Nov, 2007 - 08:55 PM
|