|
Sorry, I didn't mean for you to understand it. I've read a few of your articles, I've no doubt at all that you know what your doing I just meant for Exelioindia to be careful with using that. Probably should have made that clearer.
Simon
|
|
|
|
|
It's ok
Simon Stevens wrote: I've read a few of your articles,
Hope you liked them
Giorgi Dalakishvili
#region signature
my articles
#endregion
modified on Tuesday, April 8, 2008 5:39 AM
|
|
|
|
|
Hello
I face a problem with datagridview when want to retrive the particular row index.
In my application I select more then one row by presssing control key. After that when I want to retrive the row index from selected rows then it return wrong row index.
So plz help me regarding this.
Debasmita
|
|
|
|
|
Could please be more descriptive.
Anyways this works fine for me:
int i = this.dataGridView1.SelectedRows[1].Index
Until you realize this message has nothing to say, its too late to stop reading
|
|
|
|
|
checking how many rows are selected in the grid.
First column is check box column.
this code will help to learn something
int count =0;
foreach (DataGridViewRow row in dgrdviewBranch.Rows)
{
bool selectrow = Convert.ToBoolean(row.Cells[0].Value);
if (selectrow == true)
{
count += 1;
}
}
|
|
|
|
|
The command line prompt for running winzip. The below command zips "1.txt" file into "zippy.zip"
C:\Program Files\WinZip>winzip32.exe -min -a D:zippy.zip D:\\1.txt
I want to do this programatically using C# using Process.Start(). I have trouble specifing the parameters for winzip exe. If i give only the exe name as below winzip application opens
System.Diagnostics.Process.Start("C:\\Program Files\\WinZip\\winzip32.exe");
When i try giving the parameters(file name etc) as below it gives an error at run time "The system cannot find the file specified"
System.Diagnostics.Process.Start("C:\\Program Files\\WinZip\\winzip32.exe -min -a D:zippy.zip D:\\1.txt");
I'm not sure if there is any problem with double quotes "". How can i specifiy the paramters? Please help
|
|
|
|
|
You specify the parameters as an argument, and I suspect you need to put the full path in quotes because it has a space in it. So, you're writing a program that will only ever run on your personal PC, no-one else will ever use it ?
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
I have specified the path in quotes but still not working. Can you please provide code snippet?
My requirement is that the files should be zipped using Winzip only so that user can unzip it. If i use System.IO.Compression.GZipStream then i cannot unzip the files. Again i need to have a program for decompression.
|
|
|
|
|
I found the solution. I was using Process.Start with 1 paramters instead of using 2 parameters (2nd paramenter for argument). Thanks for all your help
|
|
|
|
|
OK, I thought that might be it, too. Either way, I still think you're doing it the wrong way
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
I'd take a look at doing this in process if I were you. There are several free third party assemblies which will help you here. ICSharpCode.ZipLib does the job just dandy.
Regards,
Rob Philpott.
|
|
|
|
|
i am using C#.net 1.1 while using clipboard m geeting this exception
System.Threading.ThreadStateException: Current thread must be set to single thread apartment (STA) mode before OLE calls can be made. Ensure that your Main function has STAThreadAttribute marked on it.
at System.Windows.Forms.Clipboard.GetDataObject()
|
|
|
|
|
// [STAThreadAttribute]
[STAThread]
public static void Main()
put that attribute in your entry point.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
i have made an entry [STAThread]
public static void Main()
still m getting the exception
|
|
|
|
|
OK - well, that's how you set it. Do you set the thread model to something else, elsewhere in your code ? I don't even know if you can, but that attribute is what it's telling you to set. Have you googled the error message text ?
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Ya i have googled but itz saying to set entry point as what u said. but i cant figure out the exception
|
|
|
|
|
Are you trying to access your object from a background thread?
|
|
|
|
|
M trying to access Clipboard.GetDataObject();
it is throwing exception when accesing clipboard
|
|
|
|
|
hello
how can i save state of a controls in an xml file ??...later I need to load and generate in my form...anyway to do that..?? (those controls generated dynamically)
|
|
|
|
|
You need to write the code to save and reload your controls and their state, there's nothing built in that I know of
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
I think you can use seralization and deseralization then solve your issue.
Continue...
|
|
|
|
|
i need to zip the files/folder. How can i use winzip32.exe in C# code to programatically zip the files or folder. If you could provide some sample code that would be great. Thanks
|
|
|
|
|
Process.Start will start winzip, so I guess if you can provide the files on the command line, that will do it for you. I thought zip support was built in now, I know for sure there are third party libraries you can use. WinZip is a commercial product, you need for your users to buy it if you use it for zipping.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
|
I found the class System.IO.Compression.GZipStream which might serve the purpose. I have never used it though.
Have you come across this class??
Until you realize this message has nothing to say, its too late to stop reading
|
|
|
|