|
my need is to create a program for saving all the open files using .net framework which will save any Unsaved application files such as MS Word, Excel, Adobe Pagemaker , Macromedia Applications etc.
|
|
|
|
|
You'll have an very difficult time with this. Since every app is different and you can't save files at just any old time (like when an app has a modal dialog box open!), you'll have to handle every possible instance that could occur to stop you.
Basically, what I'm trying to tell you is that what you want to do isn't practical. You might get about 80% compatibility with the applications. Depending on what's going on in the app at the time, you're save attemt will fail. Also, what if the user has a document open that he doesn't want the changes saved for?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Dear All,
Does anybody know how to read properties of an EXCEL file from C# application.
I want to see those properties when I right click on a file and select properties.
Jayant D. Kulkarni
Brainbench Certified Software Engineer in C#, ASP.NET, .NET Framework and ADO.NET
|
|
|
|
|
Guys, It's done.
Dim objwb As Excel.Workbook
Dim objapp As Excel.Application
Dim result As Object
Dim val As String
Dim name As String
Dim count As Integer
Dim i As Integer
objapp = New Excel.Application
objapp.Visible = True
objwb = objapp.Workbooks.Open("c:\Test.xls")
'Get properties count
' count = Int32.Parse(objwb.BuiltinDocumentProperties.GetType().InvokeMember("Count", BindingFlags.GetProperty, Nothing, objwb.BuiltinDocumentProperties, New Object() {}).ToString)
count = Int32.Parse(objwb.CustomDocumentProperties.GetType().InvokeMember("Count", BindingFlags.GetProperty, Nothing, objwb.CustomDocumentProperties, New Object() {}).ToString)
For i = 1 To count '(Count property is not zero-based index)
'Get Document Property at specified index
result = objwb.CustomDocumentProperties.GetType().InvokeMember("Item", BindingFlags.GetProperty, Nothing, objwb.CustomDocumentProperties, New Object() {i})
'Get Property Name
name = result.GetType().InvokeMember("Name", BindingFlags.GetProperty, Nothing, result, New Object() {}).ToString
Try
'Get value for Property (some properties will throw an exception if you try to access their property)
val = result.GetType().InvokeMember("", BindingFlags.GetProperty, Nothing, result, New Object() {}).ToString
Catch ex As Exception
val = "None"
End Try
'Show Property name and Value
MsgBox(name.ToString & ": " & val.ToString)
Jayant D. Kulkarni
Brainbench Certified Software Engineer in C#, ASP.NET, .NET Framework and ADO.NET
|
|
|
|
|
Hi,
Is there a way to set a threshold value to a received audio stream? Cos i need to measure the delay of a live stream; from the time a sound is produced, to the time it is received on a client computer pulling the stream (using windows media player). I would use the same client computer to start the timer and produce a repetitive sound. The other computer would capture the sound via a mic, encode, and push it to the server. Problem is since everything is on the same session, i need to differentiate the silence in between the sounds, and the sounds themselves. So setting a threshold would probably do the job.
Any good audio libraries i can use? Hope someone can advise me on this... Thanks!
Cheezo =)
|
|
|
|
|
I have no ideas about any libraries for this. But I can tell you form a little experience myself, that the delay varies constantly and can be as high as 10 seconds on a LAN. The bulk of the delay depends on the encoders being used, the number of bit rates being generated and how fast they are supposed to be, and the server serving up the content.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
You're right. Actually i used a stopwatch to measure the delay, but the problem is it isn't accurate especially when i need to measure jitter as well, which is in the range of milliseconds.
Was wondering if it's possible to set a counter on the audio stream so that i can get the difference in time by taking the difference of the counters.
|
|
|
|
|
There's just no way to do this reliably. The delay VARIES CONSTANTLY with CPU load, encoding input load and the variable outputs. It's impossible to get what you want.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Are you an engineering student? HAve you worked on any simulation software such as SIMULINK, FLUENT, SYMBOLS 2000. They all are engineering softwares for simulating different engineering systems. I want to know how to develop an application such as simulink drawing pad, one which you can drop different objects from the library to the drawing board and then connect them and the simulate the whole system. The objects behaviour as well-defined previously and they interact with each other as time progress and the final output is shown.
In one line, how to go about creating another SIMULINK, as MAthWorks people done? how to creat a drawing software liek say MS Paint which has some predefined library shapes Can this be done with C#?
This is the place where I think my problem is explained better.
http://web.ics.purdue.edu/~amohanty/SimulationPad.pdf[^]
I don't really need a solution to this problem in this forum, but all I want is one or two lead to start working on that.
REgards,
Amit
-- modified at 0:06 Friday 26th August, 2005
|
|
|
|
|
wad's the difference between:
string a = string.Empty;
string a = null;
|
|
|
|
|
String.Empty is a defined value for a string instance of zero length, it is not null.
string a = null is an uninitialized object of type string, but since it is uninitialized, it is not valid to reference (cant't call any methods on it, or reference it without an exception being raised).
string a = null;
string b = string.Empty;
a.Compare(b); //raises null ref exception
b.Compare(a); //raises null reference exception
string c = "x";
c.Compare(a); // null reference
c.Compare(b); //valid statement
Absolute faith corrupts as absolutely as absolute power
Eric Hoffer
All that is necessary for the triumph of evil is that good men do nothing.
Edmund Burke
|
|
|
|
|
In my eye.
string a = string.Empty; is the same as string a = "";
|
|
|
|
|
They are equal, but neither one is null.
Both of your code samples represent an instantiated object of type string holding a value of zero length. You can call methods and get/set properties on instantiated objects.
A string cal also be null, in which case it doesn't refer to any instantiated object. Therefore, you can't call any methods or modify any properties on it.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Yes and no.
String.Empty is a defined constant contained in the string class.
"" is defining a new string value of zero length in your own class, which is equivalent to srting.empty. The compiler may well just use string.Empty here, or it may intern a new string value in your assembly. It is probably better practice to use the existing string constant (string.Empty) when initializing strings, since it is certain what happens.
Absolute faith corrupts as absolutely as absolute power
Eric Hoffer
All that is necessary for the triumph of evil is that good men do nothing.
Edmund Burke
|
|
|
|
|
In my mind's eye Horatio...
/\ |_ E X E GG
|
|
|
|
|
I think a better question would be..
wad's the difference between:
string a=String.Empty;
string a="";
/\ |_ E X E GG
|
|
|
|
|
The answer: nothing.
String.Empty is defined as "" in System.String's static constructor, and it's a static readonly field.
By the way, .NET 2.0 has a string.IsNullOrEmpty function, which is sorta cool.
|
|
|
|
|
Hot discussion!
I have another topic: what's the difference between "==" and method "Equal". are they same?
It is quite confusing! In jave language, "two object Equal" means the refs pointing to the same memory address. But in C#, I find it is different. You can use if( stringA == "aa" ) instead of if( stringA.Equal("aa" ); Any ideas?
Radic Feng
Beijing, China.
|
|
|
|
|
* Operator equality in C# compares refs pointing while Equals compares values equality.
BUT:
* For strings Operator equality in C# performs value type equality meaning it actually compares the values in the addresses. (Partially it's due the fact that strings are immutable in C# and usually we want actually to compare the values and not the addresses of the instances). In C# Operator equality makes internal call to string.Equals (thus results in slightly poorer performance).
|
|
|
|
|
|
hi
how do i specify criterior using textbox and button in form1 and display results using textbox controls in form2?
thanks! =)
-- modifed at 21:12 Thursday 25th August, 2005
|
|
|
|
|
Hi,
u can do in this way.
string sql = "select * from tabel1 where column1 = '" + txtCol1.Text.Trim() + "'";
Now result is something say a string result.
You create the object of Form2 and assign the value to textbox on it.
Form2 frm = new Form2();
frm.txtResult.Text = result;
frm.Show();
Jayant D. Kulkarni
Brainbench Certified Software Engineer in C#, ASP.NET, .NET Framework and ADO.NET
|
|
|
|
|
hi
sorry, im afraid i don get you.
do you mind having a look here: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon/html/vbwlkwalkthroughdisplayingdatainwindowsformusingparameterizedquery.asp
i did something like that and it worked. but i do not want the data to be displayed in the same form as the textbox and button.
what should i do to allow user to type and send query in form1 and for data to show in another form (form2)?
please explain as simply as you can because im just a beginner. i appreciate your effort and reply. thank you! =)
|
|
|
|
|
Ok, just tell me what do u get as a result after executing the query?
a dataset, a single value or what?
Jayant D. Kulkarni
Brainbench Certified Software Engineer in C#, ASP.NET, .NET Framework and ADO.NET
|
|
|
|
|
jdkulkarni wrote:
Ok, just tell me what do u get as a result after executing the query?
do you mean what do i want to achieve for my app or what did i get by following the steps in the url?
if u meant what i want to achieve, i want to let user type any ID no. in textbox1 as a criteria for their search (my access db will then get only the data belonging to THAT ID no. only). they'll press GO (button1) which sends query to db. and the data is to be shown in textbox controls placed in a 2nd form, which is a different form from where i placed textbox and button.
if u meant what i got from the steps i followed in that url, i managed to get the specified data that i want from db but the data is displayed in textboxes in the same form as textbox1 and button1.
thanks!
|
|
|
|