|
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 )
|
|
|
|
|
|
How can I set a public value of a parent form from a child form?
|
|
|
|
|
It's easy!
You can pass your parent form to child form, and then you can do what you want.
have fun.
If we dream, every thing is possible!
|
|
|
|
|
Don't make it public. Use delegates to create communication between forms. You can pass form instances around, but it's ugly, and hacky. Delegates are the right way to do this. There's a CP article on passing data between forms which covers this nicely.
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 )
|
|
|
|
|
you must declare the parent property (Property Procedure) as static in the parent form then u can set it from any child form.
in the child form just by accessing the parent property like this
ParentFormName.StaticProperty = anyValue;
|
|
|
|
|
dear friends,
USB Pen Card is connected or not
|
|
|
|
|
You can iterate over the drives available and see if one is removable. The DriveInfo class in the System.IO namespace is, from memory, what you need.
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 was wondering if anyone can assist me..
I have this code below:
DataTable dtSource = m_dtUsed;
DataTable dtDest = dtSource.Clone();
foreach (DataRow dr in dtSource.Rows)
{
DataRow drNew = dtDest.NewRow();
// this code work perfectly
object[] obj = new object[dr.ItemArray.Length];
dr.ItemArray.CopyTo(obj, 0);
drNew.ItemArray = obj;
dtDest.Rows.Add(drNew);
// why this code can't work?
// after dr.ItemArray.CopyTo(drNew.ItemArray, 0), i find drNew.ItemArray is still empty,i don't know why?
//drNew.ItemArray = new object[dr.ItemArray.Length];
//dr.ItemArray.CopyTo(drNew.ItemArray, 0);
//dtDest.Rows.Add(drNew);
}
Any help would be appreciated.
If we dream, every thing is possible!
modified on Saturday, May 31, 2008 10:13 AM
|
|
|
|
|
What does 'not working' mean ? What does it do instead ? What does MSDN say ?
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 )
|
|
|
|
|
Thanks Christian Graus for your reply.
The issue is :
After "CopyTo" operation, the destination array(here is drNew.ItemArray) is still empty.
If we dream, every thing is possible!
|
|
|
|
|
dealon wrote: // this code work perfectly
object[] obj = new object[dr.ItemArray.Length];
dr.(obj, 0);
That won't even compile.
dealon wrote: // why this code can't work?
//drNew.ItemArray = new object[dr.ItemArray.Length];
//dr.ItemArray.CopyTo(drNew.ItemArray, 0);
//dtDest.Rows.Add(drNew);
The ItemArray property returns a new object array that contains references to the data in the data row. You are copying the data to this array, and then you are throwing it away. Replacing the references in the object array doesn't change the data in the data row.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Thanks Guffa for your help.
I think my incorrect code copied confused you.
The fact is like this:
1)This code can work and the drNew.ItemArray have my wanted data.
------------
object[] obj = new object[dr.ItemArray.Length];
dr.ItemArray.CopyTo(obj, 0);
drNew.ItemArray = obj;
2)But the method below seems bad.
------------
drNew.ItemArray = new object[dr.ItemArray.Length];
dr.ItemArray.CopyTo(drNew.ItemArray, 0);
dtDest.Rows.Add(drNew);
i found drNew.ItemArray is still empty.I don't known why?
If we dream, every thing is possible!
|
|
|
|
|
dealon wrote: i found drNew.ItemArray is still empty.I don't known why?
I already explained why: The ItemArray property creates a new array. Changing anything in that array doesn't change anything in the DataRow. So, you create a new array, fill it with data, and throw it away.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|