|
hi,
I thought in the namespace System.Management, I would find classes / methods or rather some interface
that I can use to get some management information, say about IIS.
But System.Management only has attributes like 'ManagementConfigurationAttribute' which states that
the property is read-only.
So how do I get the interface to access information about IIS in a console application.
Regards,
NetQuestions
|
|
|
|
|
What kind of information are you speaking about? You can use WMI for information about IIS. See if this[^] helps.
|
|
|
|
|
Hi,
I have gridview.
I need to export the data to excel and zip it
I had used dot net zip free dll
The zip file is not having the excel.
Need help how to include the excel file in zip
the below code creates zip file
using Ionic.Zip;
using System.Text;
using System.IO;
using Ionic.Zlib;
protected void btn_Export_Click(object sender, EventArgs e)
{
HtmlForm form = new HtmlForm();
string attachment = "attachment; filename=Employee.xls";
Response.ClearContent();
Response.ContentType = "application/ms-excel";
System.IO.StringWriter stw = new System.IO.StringWriter();
HtmlTextWriter htextw = new HtmlTextWriter(stw);
form.Controls.Add(grd);
this.Controls.Add(form);
form.RenderControl(htextw);
var filesToInclude = new System.Collections.Generic.List<String>();
if (filesToInclude.Count == 0)
{
Response.Clear();
Response.BufferOutput = false;
System.Web.HttpContext c = System.Web.HttpContext.Current;
//string archiveName = String.Format("Employee.zip", DateTime.Now.ToString("yyyy-MMM-dd-HHmmss"));
string archiveName = String.Format("archive-{0}.zip", DateTime.Now.ToString("yyyy-MMM-dd-HHmmss"));
Response.ContentType = "application/zip";
Response.AddHeader("content-disposition", "filename=" + archiveName);
// ZipFile zip = new ZipFile();
using (ZipFile zip = new ZipFile())
{
//zip.AddFile("export.xls", "content");
zip.Encryption = EncryptionAlgorithm.WinZipAes256;
// filesToInclude is a string[] or List<String>
zip.AddFiles(filesToInclude, "files");
zip.Save(Response.OutputStream);
// zip.Save(archiveName);
}
Response.Close();
}
}
Thanks
S.Guhananth
|
|
|
|
|
Member 3222264 wrote: //zip.AddFile("export.xls", "content");
..why is that line commented out?
I are Troll
|
|
|
|
|
tried
zip.Addfile("export.xls","content");
getting this error
C:\Program Files\Common Files\Microsoft Shared\DevServer\10.0\Employee.xls
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.IO.FileNotFoundException: C:\Program Files\Common Files\Microsoft Shared\DevServer\10.0\Employee.xls
|
|
|
|
|
Member 3222264 wrote: tried
That was the part that seemed to be used to add files to the zip-archive. An empty list of files will result in an empty archive.
Member 3222264 wrote: getting this error
Check if the file below exists;
C:\Program Files\Common Files\Microsoft Shared\DevServer\10.0\Employee.xls
If the file doesn't exist, then it won't be added to the archive. Make sure you call the code that creates the Excell-file before adding it to the list.
I are Troll
|
|
|
|
|
while exporting to excel how the file will be in this path
the below works fine to export it as excel
HtmlForm form = new HtmlForm();
string attachment = "attachment; filename=Employee.xls";
Response.ClearContent();
Response.AddHeader("content-disposition", attachment);
Response.ContentType = "application/ms-excel";
System.IO.StringWriter stw = new System.IO.StringWriter();
HtmlTextWriter htextw = new HtmlTextWriter(stw);
form.Controls.Add(grd);
this.Controls.Add(form);
form.RenderControl(htextw);
Response.Write(stw.ToString());
Response.End();
but i do not know why the Employee.xls is not attached to excel
Do u have sample code to zip the file and export?
|
|
|
|
|
Member 3222264 wrote: but i do not know why the Employee.xls is not attached to excel
Well, the above code doesn't generate a file on disk. And that's what the code that's doing the zipping is expecting.
Member 3222264 wrote: while exporting to excel how the file will be in this path
What data is in that streamwriter? ..and what happens if you write that data to a file?
I are Troll
|
|
|
|
|
Please read the forum guidelines and use pre tags when posting code.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
in crystal report whatever i am sending through dataset, all the columns of the database it is displaying in crystal report but only date column field is not binding. It is not getting value. but in dataset the date column has a value. Reply . Thanks in advance.
|
|
|
|
|
using mysql select query, i am sending dataset to crystal report and i am getting the result. But i want get only one row for particular ID. We are making 3 or more times transaction. So 3 rows is coming. For taking only one row, how to write formula in total field in crystal report so that it will add all those amount for that particular id and display only one row with the sum of that amount. thanks in advance.
|
|
|
|
|
Hi,
In winforms or wpf application, lets say there is one container control which adds controllers dynamically and it also adds event handlers of that child controls.
Now if I call a clear method of the parent container control, will the event handlers added be removed automatically?
If not and I dont remove them (event handlers), will it create any other issue?
Please suggest!
Thanks,
Divyesh
|
|
|
|
|
when you clear a container control, it disposes of all the contained controls; each control will be available for garbage collection, and the event members they contain will have no influence, just like any other data members. There is no need to remove handlers at all.
BTW: The same applies to a modeless form that gets closed.
|
|
|
|
|
Hi
Is there a way of installing other software such as MySQL in a setup project. If so is it also possible to execute a script to create a database?
Thanks
|
|
|
|
|
|
In C#2.0,the Codedom library how to generate the method of foreach?
|
|
|
|
|
A foreach is actually a convenience wrapper around a loop with an enumerator. That's what you need to enumerate over. Try to create a CodeDOM for this instead:
IEnumerator e = item.GetEnumerator();
while(e.MoveNext())
{
myList.Add(ConvertToObject(item));
}
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
Hi,
I have an application in C# that use SQL Server 2008 R2 Express.
When i install the package i need to choose option and to install:
1. Microsoft .Net Framework 3.5 SP1.
2. Windows Installer 4.5.
3. Windows PowerShell 1.0
I have an SQL Script that will build my DB at SQL 2008 R2 Express and will add the user configuration that i want.
I want to make install package that will include the SQL 2008 R2 Express (including "Microsoft .Net Framework 3.5 SP1.",
,"Windows Installer 4.5" and "Windows PowerShell 1.0 ").
Will run the script and install my application.
I don't want to let the user to choose configuration for the DB in the installation process.
How can i do that?
Thanks,
Shai.
|
|
|
|
|
|
Guys;
I used system.drawing.Image to get a MetaFile, the type is an EMF file:
Image img= new Metafile(new System.IO.MemoryStream(), HDC,rc, MetafileFrameUnit.Pixel, EmfType.EmfOnly);
After an EMF file is created. I need to convert it to Bitmap, using: img.Save(sTempfilename, ImageFormat.bmp); Its background becomes black. I think i can not save directly since the format is different.
Would you give some suggestions on how to convert the EMF image to a Bitmap? Thanks very much.
|
|
|
|
|
|
Thanks a lot!
|
|
|
|
|
My Pleasure.
Jinal Desai - LIVE
Experience is mother of sage....
|
|
|
|
|
Do you want to develop Rich Internet Applications for the enterprise? Do you want to know how Flex integrates with enterprise services using LiveCycle DS/BlazeDS? Anne Kathrine Petteroe will be in Bangalore this August to explain how you can use Adobe's Flash Platform to develop Rich Internet Applications for the enterprise. It will starts with discussing the typical challenges of enterprise application development and why choosing the right UI strategy is important. This part also covers architectural considerations. Next, see how Flex integrates with enterprise services using LiveCycle DS/BlazeDS or Web Services. At Adobe Flash Platform Summit 2010, to be held 25-26 August, Anne will also give examples and experiences from integrating with SAP back-end.
Anne Kathrine Petteroe is an Enterprise Platform Evangelist at Adobe. Before joining Adobe she was a SAP consultant with focus on UI development and strategy, as well as RIAs, Flex and form design. She is also the co-lead of ESME, an open source micromessaging platform for the enterprise.
Attend AFPS 2010 for the sheer value of the content! No other conference in India offers such a comprehensive mix of technical and creative content, delivered by the industry's leading speakers and platform experts. Across two days, you have access to over forty presentations including inspiring keynotes from legendary Adobe speakers. You also have the opportunity to hang out at the expo area and connect with Adobe partners, industry leaders and peer developers and designers. With over 2000 attendees sharing the same passion as you, imagine the opportunities to network and further your goals.
Need more reasons? As the single, largest Flash Platform conference in India, at AFPS you get to hear about stuff in the roadmap and future directions before anyone else. Some of the specific highlights include: deep dive sessions around the latest product releases in the Adobe Flash Platform including exciting recent developments like Flash on devices, and targeted sessions for newcomers to the platform as well. For more information, visit: www.adobesummit.com
AFPS 2010 is homespun by Saltmarch Media, producers of Great Indian Developer Summit and Developer March – India’s biggest and independent polyglot conference and portal for software developers.
A Saltmarch Media
E: info@saltmarch.com
Ph: +91 80 4005 1000
|
|
|
|
|
shankarjain2010 wrote: As the single, largest Flash Platform conference in India
You really are a grade A, full blown, moron of the highest order. First of all, this is advertising, so you shouldn't be posting it in the forums - secondly, and this proves you are a wlueless canker, what has this got to do with .NET?
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|