|
use this method i find it easier
if (folderBrowserDialog1.ShowDialog() == DialogResult.OK) { txtboxSelectExcelDir.Text = folderBrowserDialog1.FileName; }
String info = String.Empty;
using (StreamWriter sw = File.CreateText(folderBrowserDialog1.FileName)
{
sw.Write(
Make sure the info is seperated by tabs, to indicate different cells
for example,
col1, row1\tcol2, row1\r\ncol1, row2\tcol2, row2
|
|
|
|
|
This means that I would have to change my whole code process. I just need to know how to pass the Directory path to the save function. CHanging the coding I have done is not much of an option.
Excellence is doing ordinary things extraordinarily well.
|
|
|
|
|
objExcel.ActiveWorkbook.SaveAs(Path.Combine(txtboxSelectExcelDir.Text, namefile + "_Nom022.xls"),...
|
|
|
|
|
It works 100%. Thanks for that Shree
Excellence is doing ordinary things extraordinarily well.
|
|
|
|
|
I have seen programs which add plugins to other ones, such as internet explorer, as a .dll. How can I code my own .dll plugin for another application (I was thinking of MSN Messenger)?
Thanks in advance.
|
|
|
|
|
|
Programs that are designed to be extended using plugins usually have a published API documentation. You need to find these and code accordingly.
|
|
|
|
|
Hi All,
I wrote some application and i need in some place to catch the keyboard pressed key - so i used windows hook - now i have the scan code of the pressed key but i cant convert it to the real key that the user pressed.
How can i know from the key scan code what is the real key ?
Is there some .Net class that can give me the pressed key when the input is the scan code ?
Thanks for the help
|
|
|
|
|
Hi,
you don't need a hook to catch the keys sent to an application.
Just have your main form's KeyPreview set to true, and use its KeyPress or KeyDown event.
The EventArg contains all you need.
|
|
|
|
|
I just want to know how to find out the key from the scan code.
|
|
|
|
|
The way I do this is to use an xml file, which I created, with the corresponding key explanations.
Click here for the file (it will only be there for a short while!)
Microsoft in its wisdom has removed the codes from the web, or moved the site, as it was there two weeks ago and now...
As far as I know there is no class to convert these codes into 'meaningful' key descriptions for the user.
One thing to be aware of is that depending on which country/keyboard used you may not have all the keys covered.
Regards
Guy
Continuous effort - not strength or intelligence - is the key to unlocking our potential.(Winston Churchill)
|
|
|
|
|
Good Day,
I'm using SharpZipLib Zip library in my application. Basically, after extracting the files, I wish to delete the original zip file.
However, SharpZipLib does not close its handle to the zip file. So when I try to delete, I get an exception.
Is there anyway to delete the file with active handles?
Thanks!
It is said that the most complex structures built by mankind are software systems. This is not generally appreciated because most people cannot see them. Maybe that's a good thing because if we saw them as buildings, we'd deem many of them unsafe.
|
|
|
|
|
Ian Uy wrote: Is there anyway to delete the file with active handles?
not before closing it, there must be something in the library that will terminate the handle, that a pretty big blow to functionality otherwise .
|
|
|
|
|
Hmmm. If I put everything in a class and dispose it, will it close the stream?
The thing is, I only have the DLL file so I can't make changes to the code.
It is said that the most complex structures built by mankind are software systems. This is not generally appreciated because most people cannot see them. Maybe that's a good thing because if we saw them as buildings, we'd deem many of them unsafe.
|
|
|
|
|
Ian Uy wrote: Hmmm. If I put everything in a class and dispose it, will it close the stream?
I've tryed that in the past as well, but its unpredictable, sometimes it works, other times it does not. It really depends on what technologies your working with.
Ian Uy wrote: The thing is, I only have the DLL file so I can't make changes to the code.
If there is something in the class library to open a stream, there will be something in there to close it. If it has documentation, find the method that opens it, and im sure the method that closes it is near-by. If it is still not closing then the problem may be elsewhere.
Cheers,
|
|
|
|
|
The salient facts of the case:
List<IMyInterfaceOne> myList;
IMyInterfaceOne : IEnumerable<IMyInterfaceTwo>
{
}
MyMethod(IEnumerable<IEnumerable<IMyInterfaceTwo>> mySource)
{
}
When I try to pass myList into MyMethod, it won't compile.
|
|
|
|
|
Will Montgomery wrote: When I try to pass myList into MyMethod, it won't compile.
Because one is not derived from the other.
|
|
|
|
|
Hi
The datagrid displays the contents of the dataset. Changing values in the datagrid leaves the dataset unchanged.
From everything that I have read using grid.datasource = dataset or datagrid.databinding = dataset should work.
But with me it doesn't.
Thanks,
Nigel Mackay
|
|
|
|
|
Hi all...
In VB:
Dim endDate as String = CType(gridCC.Rows(e.RowIndex).FindControl("TextBox1"), TextBox).Text
Equivalent in C#?
Thanks in Advance.
|
|
|
|
|
string endDate = ((TextBox)gridCC.Rows(e.RowIndex).FindControl("TextBox1")).Text
or
string endDate = (gridCC.Rows(e.RowIndex).FindControl("TextBox1") as TextBox).Text
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
To add to what Guffa said, you should use 'as' because it will not blow up if the object is not a textbox, it will just set it to null.
You should also create a textbox variable first, check if it's not null, THEN check it's 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 )
|
|
|
|
|
Hi Friends,
I have to run ffmpeg commands(userd to Transcode audio and video) from c#.
Actually I'm trying to make one dll with one method which does this transcoding of audio and video.
ex: c:\\ffmpeg\\bin\\ffmpeg.exe -i c:\\ffmpeg\\bin\\ish.mp4 -y sample.mp4
The above command generates one sample.mp4 video file by taknig ish.mp4 as input. This is not fixed commands will generate at runtime based on the input file.
So I want to run this command from .net.
I tried by using
string path = "C:\\ffmpeg\\bin\\ffmpeg.exe";<br />
string fileargs = "ffmpeg -i ish.mp4 -s cif -vcodec h263 -acodec libamr_nb -ar 8000 -ac 1 -ab 12.2k sampleish12.3gp";<br />
Process p = new Process();<br />
p.StartInfo.FileName = path;<br />
p.StartInfo.Arguments = fileargs;<br />
p.StartInfo.UseShellExecute = false;<br />
p.StartInfo.CreateNoWindow = false;<br />
p.StartInfo.RedirectStandardOutput = false;<br />
p.Start();<br />
p.WaitForExit(50000);
but it is not giving any output file
Thanks
HariBabu
|
|
|
|
|
remove ffmpeg from your file args. This is how your command sent in code differs from your example.
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 )
|
|
|
|
|
Hi all...
I think my subject line not dat much clear...
Here is My Requirement:
*I hav windows project ..it displays ads in the masterform.. and also
*I hav webproject in dat user is going to add their adds(i mean de can register their ads in dis webproject)
Actually Client uses the Windows project.. when client is connected to internet and opens our website(our webproject) den we have to upload our ads which r registered in our webproject into ClientSystem(Window project) in place of ads(In masterform we r providing place for Displaying ads..AdRotator )..
How can i achieve this.. how can i solve dis by WebServices/WinodwsServices...
Plz..Help me in dis issue...I need ur suggestions....
Thanks&Regards,
kvsekhar
|
|
|
|
|
hav, dat, dis, ur, de, these are not words. Please don't speak like a retard, we're not 7.
I guess you need a web control in your form, which can paint direct to your ad page, or to urls provided by the webservice.
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 )
|
|
|
|