|
Yes that is what I am trying to do.
the variable name comes form the directory info. class. I then want to pass the 'name' of the file precededed by the folder 'reports'. So just like you mentioned it would dynamically create the report path. Hmph. Nothing is ever easy when your new.
modified on Tuesday, April 21, 2009 12:37 PM
|
|
|
|
|
Hello,
Does anybody know how to return $? and $LASTEXITCODE back to the C# caller after a script has been executed using Jean-Paul Mikkers async powershell code execution from c# article here on code project with the address below.
Asynchronously Execute PowerShell Scripts from C#[^]
regards
Bob.
|
|
|
|
|
Dear sir,
i want to control system sound using wpf slider control.
how can i do?? any idea??
yogesh
|
|
|
|
|
did you even try and google that, if you don't know how more info can be found here[^]
this might help either
clickety[^]
|
|
|
|
|
Dear sir,
i have searched in google but i didn't get anything . that is why i posted here.
yogesh
|
|
|
|
|
|
buachaill cliste wrote: did you even try and google that, if you don't know how more info can be found here[^]
Awesome. That's the best thing since www.lmgtfy.com[^]
Today's lesson is brought to you by the word "niggardly". Remember kids, don't attribute to racism what can be explained by Scandinavian language roots.
-- Robert Royall
|
|
|
|
|
I was going to do that but I kept getting a DNS error
But I can go everywhere else lol
Just when ya want it
|
|
|
|
|
Hi,
I have an instance of Bitmap that I want to save as an PNG with Indexed colour mode. How can I do this in .NET?
Thanks,
Steve
|
|
|
|
|
Don't know about indexed colour as I've never had the necessity to do it before and google might help
but this:
Bitmap bmp = new Bitmap(x,y);
bmp.Save("c:\\bmp", System.Drawing.Imaging.ImageFormat.Png);
|
|
|
|
|
That always saves as ARGB png as far as I know..
|
|
|
|
|
Oh ok. I didn't know
Just tryin' to help
|
|
|
|
|
Hi,
I don't think .NET supports indexed colors for PNG.
This MSDN page[^] says PNG needs 0 bytes for parameters, so there is nothing to choose from.
|
|
|
|
|
For anyone else who wants to achieve this, the FreeImage project provides support for a large number of image codecs and colour modes and has bindings for C#. It is what I used to create a PNG8 file.
Steve
|
|
|
|
|
I'm hoping someone can help me here ...
I have a project that is working well connecting to an Access database file, making queries etc. I discovered that one of the fields in the database is of the wrong type (it is Int32, i want it Text).
- I changed the field type in the database (via Designer View in Access)
- I changed the field type in DataSet in my project (DatabaseDataSet.xsd)
- I changed the data type in the .Add routine.
However, when I compile, the tableadapter .Update command complains about not being able to convert String to Int32. I can't find what else needs to be changed!
Any ideas please ?
Andy
|
|
|
|
|
God I hate MS adapters. Destroy the adapter and rebuild it on the changed table.
The problem with the adapters is the dev who knows nothing else has no idea how they work and therefore when something goes wrong gets stuck with nowhere to go. Recommendation - do some research into a decent Data Access Layer (DAL) there are lots of samples out there and if you are serious about being a dev you need to be able to build one! Sorry rant over.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
I had this code working yesterday. Today I get "Attempted to read or write protected memory. This is often an indication that other memory is corrupt."
Here's the code. It errors on the oSheet.SaveAs line:
Microsoft.Office.Interop.Excel.Application oXL;
Microsoft.Office.Interop.Excel._Workbook oWB;
Microsoft.Office.Interop.Excel._Worksheet oSheet;
oXL = new Microsoft.Office.Interop.Excel.Application();
oWB = (Microsoft.Office.Interop.Excel._Workbook)(oXL.Workbooks.Add(Missing.Value));
oSheet = (Microsoft.Office.Interop.Excel._Worksheet)oWB.ActiveSheet;
Reader = new StreamReader(ExportParams.sSourceFileName);
iRow = 0;
sSourceRow = Reader.ReadLine();
while (sSourceRow != null)
{
iRow++;
string[] aWords = sSourceRow.Split(',');
oSheet.Cells[iRow, 1] = aWords[0];
oSheet.Cells[iRow, 2] = aWords[1];
oSheet.Cells[iRow, 3] = aWords[2];
sSourceRow = Reader.ReadLine();
}
Reader.Close();
if (File.Exists(ExportParams.sResultFileName))
{
File.Delete(ExportParams.sResultFileName);
}
oSheet.SaveAs(ExportParams.sResultFileName,
Type.Missing,
Type.Missing,
Type.Missing,
Type.Missing,
Type.Missing,
Type.Missing,
Type.Missing,
Type.Missing,
Type.Missing);
oXL.Quit();
Everything makes sense in someone's mind
|
|
|
|
|
Hi ,
can anyone tell how to find the system memory using c#.net 3.5 windows application?
Thanks In Advance.
--Naren
|
|
|
|
|
|
Hi,
use the Ex versions, otherwise you will be in trouble when more than 2GB is present:
[DllImport("kernel32.dll")]
public static extern void GlobalMemoryStatusEx(ref MEMORYSTATUSEX ms);
public struct MEMORYSTATUSEX {
public int Length;
public int MemoryLoad;
public long TotalPhys;
public long AvailPhys;
public long TotalPageFile;
public long AvailPageFile;
public long TotalVirtual;
public long AvailVirtual;
public long AvailExtendedVirtual;
}
modified on Monday, April 20, 2009 2:29 PM
|
|
|
|
|
Hi,
I am trying to include a compression mechanism in my application. I just went through the one that microsoft provides : GZipStream class... I used the sample code given in msdn and tried to compress files... It worked well for text and document files... But when i tried to compress an exe file, say 100mb size, the compressed file that i get is of size more than 130mb... Can anyone please tell me whether this is a problem with the GZipStream Class?
Thanks in advance,
ramz_g
|
|
|
|
|
Hi,
First: Is more easy to compress text files than .exe,
Second: From msdn: http://msdn.microsoft.com/en-us/library/system.io.compression.gzipstream.aspx[^]
The compression functionality in DeflateStream and GZipStream is exposed as a stream. Data is read in on a byte-by-byte basis, so it is not possible to perform multiple passes to determine the best method for compressing entire files or large blocks of data. The DeflateStream and GZipStream classes are best used on uncompressed sources of data. If the source data is already compressed, using these classes may actually increase the size of the stream.
So I think in some way maybe the .exe is already compressed.
|
|
|
|
|
Hi Rolcr,
Thanks for the reply. And yes, I could understand that using those classes to compress files that are already compressed may increase the size. But there is something interesting. I downloaded the gzip.exe from GNU's website and used it to compress a few files. I could find that the size of an exe file reduced by about 5mb... Whereas, using the above classes, the size of the same file increased by more than 30mb. Also, both (gzip.exe and the GZipStream class) returned similar results when applied to .txt and .doc files. Please give me your opinion on this.
Thanks,
ramz_g
|
|
|
|
|
|
Hi Rolcr,
Ya.. Even i browsed through all these sites earlier today and found that there are some issues with GZipStream... Anyways, thanks for the replies...
ramz_g
|
|
|
|