|
but can I use a file and still make it available for all user profile on the same computer or it will be per user and same configuration should be done again for every user on this computer?
Technology News @ www.JassimRahma.com
|
|
|
|
|
Either: Environment.SpecialFolder.CommonApplicationData holds folders that are common to all users on a PC, while Environment.SpecialFolder.ApplicationData is user specific. I frequently use both, with a common GUID app ID folder name in each for the settings data.
Those who fail to learn history are doomed to repeat it. --- George Santayana (December 16, 1863 – September 26, 1952)
Those who fail to clear history are doomed to explain it. --- OriginalGriff (February 24, 1959 – ∞)
|
|
|
|
|
can I ask why GUID? why not the application name? any reason?
Technology News @ www.JassimRahma.com
|
|
|
|
|
Application name may not be unique: a lot of the good ones are used already!
If you duplicate an existing app name, then it's quite likely that it's config info will interfere with yours or vice versa.
GUID's are less likely to be repeated, and harder for users to find and play with! If they don't need to access it manually, then why let them have an easy route?
Those who fail to learn history are doomed to repeat it. --- George Santayana (December 16, 1863 – September 26, 1952)
Those who fail to clear history are doomed to explain it. --- OriginalGriff (February 24, 1959 – ∞)
|
|
|
|
|
I have two more questions please...
I assume the folder is writable and I don't nned special permission to write a file there even if the windows user is limited? correct?
what format you prefer to user for the file? XML?
Technology News @ www.JassimRahma.com
|
|
|
|
|
The folder is writable for all users with no special permissions required - that's kinda the whole point!
Format depends on what you are writing, and how you need it. XML is certainly an option, but I also use CSV, SqlCE, SqLite, and binary depending on what I need for the application. That's one of the reasons I wrote this: ByteArrayBuilder - a StringBuilder for Bytes[^] - it allows me to save complex data in a way that makes sense to the application classes, rather than rely on a data storage structure than may have to be kicked a few times to do what I wanted!
Those who fail to learn history are doomed to repeat it. --- George Santayana (December 16, 1863 – September 26, 1952)
Those who fail to clear history are doomed to explain it. --- OriginalGriff (February 24, 1959 – ∞)
|
|
|
|
|
Great
Thanks
Technology News @ www.JassimRahma.com
|
|
|
|
|
You're welcome!
Those who fail to learn history are doomed to repeat it. --- George Santayana (December 16, 1863 – September 26, 1952)
Those who fail to clear history are doomed to explain it. --- OriginalGriff (February 24, 1959 – ∞)
|
|
|
|
|
Hi all,i have a question about methods...
i want to write a method to connect my database and return a result like:
select * from mytable
and show it in a gridview control
how can i do it???
thank you... 
|
|
|
|
|
You haven't stated what database you want to connect to. This article[^] describes the steps to connect an SQL Server database and will help you get started.
|
|
|
|
|
thank you...
i want to connect sql server database,
i have a class and in my class i defined a method to to execute a query in my database and returns result,
and i have a gridview control on my main form to show this result.
this is my code:
class:
public class CustomerClass
{
SqlConnection con = new SqlConnection("server=(local);database=Tailor;integrated security=true;");
SqlDataAdapter da = new SqlDataAdapter();
DataSet ds = new DataSet();
public CustomerClass()
{
}
public object selectCustomers()
{
con.Open();
SqlCommand select = new SqlCommand("select * from Customers",con);
select.ExecuteNonQuery();
con.Close();
da.SelectCommand = select;
da.Fill(ds, "Customer");
return ds.Tables;
}
}
form load:
CustomerClass test=new CustomerClass();
object test2 = test.selectCustomers();
dataGridView1.DataSource = test2;
|
|
|
|
|
So, what is your problem?
|
|
|
|
|
Do a little more searching... there are plenty examples around this site, for example:
How to populate DataGridView, GridView with SQL statement in C#[^]
In general, use code similar to this in your method:
string strSQLconnection = "Data Source=dbServer;Initial Catalog=testDB;Integrated Security=True";
SqlConnection sqlConnection = new SqlConnection(strSQLconnection);
SqlCommand sqlCommand = new SqlCommand("select * from mytable", sqlConnection);
sqlConnection.Open();
SqlDataReader reader = sqlCommand.ExecuteReader();
GridView1.DataSource = reader;
GridView1.DataBind();
|
|
|
|
|
See here[^] on how to connect to the database. The returned DataSet can be bound to a grid, which will show the results.
If you're working with SQL Server, you might want to have a look at LINQ to SQL.
|
|
|
|
|
I am stuck with regular expressions. In fact, I want the 'T' to be optional, and I got a working example:
string text = "123T234";
Regex regex = new Regex(@"([0-9]{3})[T]?([0-9]{3})");
Match stuff = regex.Match(text);
Now, why doesn't
Quote: ([0-9]{4})-([1-9]|[1][0-2])-([0-2]?[0-9]|[3][0-1])[T]?([0-1]?[0-9]|[2][0-3])[:]([0-5]?[0-9])[:]([0-5]?[0-9])?.?([0-9]{1,6})[Z]?([+-]?[0-9][\.|,]?[0-9]?|[0-9]{2}?|[+-]?[0][1][0-2][\.]?[0-9]?|[0-9]{2}?)
produce a match for
2014-02-01T14:12:33Z+1
?
Any help is greatly appreciated.
[Solved by Original Griff]
Clean-up crew needed, grammar spill... - Nagy Vilmos
modified 6-Feb-14 5:45am.
|
|
|
|
|
Because the Month group explicitly excludes it:
([0-9]{4})-([1-9]|[1][0-2])
Try:
([0-9]{4})-(0?[1-9]|[1][0-2])
BTW: [0-9] is equivalent to \d which is a little shorter!
Those who fail to learn history are doomed to repeat it. --- George Santayana (December 16, 1863 – September 26, 1952)
Those who fail to clear history are doomed to explain it. --- OriginalGriff (February 24, 1959 – ∞)
|
|
|
|
|
I don't want the T to be included in any group - Wouldn't
OriginalGriff wrote: (0?[1-9]|[1][0-2])
allow months to be 0?
Maybe I am just slow, but I don't get why the solution should allow the 'T' to be missing?
Clean-up crew needed, grammar spill... - Nagy Vilmos
|
|
|
|
|
No, because it is an optional '0' followed by a non-zero digit, or a '1' followed by a '0', '1', or '2'.
'0' on it's own isn't allowed, nor is "00"
The '?' after the 'T' specifies "zero or one" instances, so it works with or without it.
Those who fail to learn history are doomed to repeat it. --- George Santayana (December 16, 1863 – September 26, 1952)
Those who fail to clear history are doomed to explain it. --- OriginalGriff (February 24, 1959 – ∞)
|
|
|
|
|
I sometimes feel blind
Many thanks for the help
Clean-up crew needed, grammar spill... - Nagy Vilmos
|
|
|
|
|
You're welcome!
Those who fail to learn history are doomed to repeat it. --- George Santayana (December 16, 1863 – September 26, 1952)
Those who fail to clear history are doomed to explain it. --- OriginalGriff (February 24, 1959 – ∞)
|
|
|
|
|
I want to develop a tool that will assess the quality of a video. I did some R&D on this and found an interface called "IQualProp", that is part of DirectShow API. I am not trying to get a sample code in C# on how to use this interface, but i am not finding anywhere. There are samples in c++ to use this "IQualProp", but not in C#. Any help on this will be great.
|
|
|
|
|
I suspect that IQualProp is only available with MFC, and thus C++.
C# has something similar for sure, but I can't say what it is.
Source[^]
Clean-up crew needed, grammar spill... - Nagy Vilmos
|
|
|
|
|
Again, how do you define "video quality"?? You have yet to define this and this is your second question on the subject.
IQualProp only returns the performance properties of a video renderer. It has nothing to do with the video signal itself.
|
|
|
|
|
Thank you for the reply.
A video without any stuck that runs smoothly is quality of video for me. I want to play a video (recorded video) and check whether it runs properly without stuck. If there is any stuck in video I want to throw a error that quality of the video is not proper. Please correct me if im wrong in understanding the quality/performance of video.
IqualProp interface has a method called "get_Jitter" which will give the variation in a video. So, I was thinking this can be of help for me.
Please guide me.
|
|
|
|
|
OK. Too bad that interface has absolutely nothing to do with the quality of the video.
That interface will give the performance stats of the video renderer, not the video itself. There is also no correlation between the renderer performance and the size of the video. The values that you get are the current moment in time performance of the renderer and are also affected by the current system load. Run through the video again and you can get different numbers.
You can play a 320x200 at 30 frames a second and still get jitter, then play a 1080p video and get none. This is not an indicator of anything related to the video.
|
|
|
|