|
Unless a file is associated with an extension in Windows Explorer, nothing is stored in the registry. Do you only want to find registered file types ? Then they are in the registry. Otherwise, you can't find them.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
I got this link from this thread..
Hope it helps.
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message". Why vote? Plz Read it here. Thank you.
|
|
|
|
|
O the thread is good.. but I do need some sample as I have no idea how to start.
|
|
|
|
|
Adrian Soon wrote: I do need some sample as I have no idea how to start.
As I wrote ~
I got this link from this thread..
Don't you see the sample code in that link? Well, it is VB code so you might need VB to C# converter.... or you can simply change this code to C# if you have some idea about VB..
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message". Why vote? Plz Read it here. Thank you.
|
|
|
|
|
Hi I tried pasting the code.
but it fails.
Conversion was attempted, however the following errors were reported:
-- line 6 col 9: invalid NonModuleDeclaration
I nt sure how to get it done.
what went wrong?
|
|
|
|
|
I created a Setup project (with Orcas beta 2) and I could see in View => User Interfaces
That there are Administrative Install screens.
What are those?
How do I use them?
How do I do an administrative install on plenty of computer?
Is there a possibility to have a silent install?
Also, in the case of the administrative install, I would like to be able to do some additional task (i.e. write some data in the registry) but I need user input for that (i.e. the registration key), how could I do that?
I mean:
- I could have an additional screen, but it has to be entered for every computer, not pratical. (beside how could I use those user input in my System.Configuration.Install.Installer subclasses?)
- could I use command line parameter in MSI? (and how could I use those user command line parameters in my System.Configuration.Install.Installer subclasses?)
|
|
|
|
|
Hi!
I need to colourize C# code on my blog. Is there any ready solution for these?
|
|
|
|
|
|
|
thanx a lot!
But I'm writing my own blog engine, so I need colourizer like some independent class.
|
|
|
|
|
i have made a small application that can load programs compiled into dll files, i managed to get the application to load my dll files correctly but now i am having issues with how to unload the dll files correctly. inside the dll program, when i go to close the program i can not use the normal means to close as it would cause the whole program including the loader to close. so if someone could please give some advice on how to properly unload a dll after its loaded, it would be very much appreciated.
|
|
|
|
|
If you load your dlls dynamically, you can unload them. If they are referenced by your project at build time, they will be loaded for the lifetime of your app instance.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Your question is not clear. Are you saying you want to unload a DLL or are you saying calling Environment.Exit() from a dynamically loaded DLL doesn't work? If it's the former, feel free to browse Google[^]
If it's the latter, there's little anybody can do without your code. FYI, I loaded an assembly using Assembly.Load , instantiated a type and called a method on it which called Environment.Exit() and the app was cleanly shut down. Again, you may want to post a code snapshot.
Cheers,
Vıkram.
Be yourself, no matter what they say.
- Sting, Englishman in New York.
|
|
|
|
|
Hi,
I am trying to convert a Big Endian data file to something readable on most Windows PCs. I do ok with integer data but I cannot convert the floating points (32-bit IEEE).
1) Is it possible for a BinaryReader to account for Big Endian, such that .ReadSingle() would return the correct value?
2) If I have to read the bytes one at a time and reverse them, is there a way to type cast it to a float?
I pursued #2 for a while, but C# type-casting seems to convert the actual value and not the binary that represents it. So the result is something like 1.12E9 instead of 89.9.
I really don't know how to make it work correctly. I would be grateful for any help.
Regards,
Piote
|
|
|
|
|
Hi,
AFAIK there is no direct .NET support for big-endian data.
You need to swap all bytes in each larger data item, whether integer or float.
The BitConverter class will help you interpreting bytes once you have put them
in the right order. See ToSingle() method.
You could construct your own BinaryReader derivative that hides the endianness
conversion, (only if BitConverter.IsLittleEndian returns true).
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips:
- make Visual display line numbers: Tools/Options/TextEditor/...
- show exceptions with ToString() to see all information
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
Thanks for help. I'll try to use that.
Regards,
Piote
|
|
|
|
|
Hi got this code that is a potential solution to my Database login problem.It was originally in VB but I ran a converter on it. Now I have a OleDbDataReader method called Item(String) that was there when the code was in VB but now does not exist on the OleDbDataReader class in C#(dont know if that possible). Here is the full code. I need help to find the equivalent of this Item method in C#. The code connects to a access database and compares a textbox password entry to one in the database under the same user name given on another textbox...
private void btnLogin_Click(object sender, System.EventArgs e)
{
//The connection string is used to describe the type of database, the security information and the location to the database.
string ConString = "Provider=Microsoft.Jet.OLEDB.4.0;Password=\"\";User ID=Admin;Data Source=\"databasename.mdb\";";
//Create a new connection object and assign the ConString Connection String above
OleDbConnection DBCon = new OleDbConnection(ConString);
// g_login is a global variable defined in a Module that captures the login name and passes it from form to form. To create this, just create a Module, say Module1.vb and in it put "Public g_login as String" {g meaning global and login to represent the global login}
GlobalVariables.g_login = this.textBox1.Text;
string strPassword = this.textBox2.Text;
if (GlobalVariables.g_login == "" || strPassword == "")
{
MessageBox.Show("You are missing information. Please make sure that both the username and password fields are filled out.", "Missing Info");
this.textBox1.Focus();
return;
}
// The database has two fields in the Users table. A UserID field, which is the primary key and declared as a text. The other field is Password, which is a text as well.
string strsql = "SELECT [UserID], [Password] FROM Users WHERE [UserID]='" + GlobalVariables.g_login + "' ";
OleDbCommand cm = new OleDbCommand(strsql, DBCon);
OleDbDataReader dr;
bool valid = false;
bool HasRows = false;
try {
DBCon.Open();
dr = cm.ExecuteReader();
if (dr.HasRows) {
while (dr.Read()) {
if (strPassword == dr.Item("Password")) {
valid = true;
}
}
HasRows = true;
}
dr.Close();
}
catch (OleDbException exO) {
MessageBox.Show(exO.Message);
}
catch (Exception ex) {
MessageBox.Show(ex.Message);
}
finally {
if (DBCon.State == ConnectionState.Open) {
DBCon.Close();
}
cm = null;
dr = null;
DBCon.Dispose();
GC.Collect();
}
iCount = iCount + 1;
if (valid == true) {
Form n = new Form4();
n.Show();
this.Hide();
}
else if (iCount == 3) {
MessageBox.Show("Contact Developers!", "Invalid Info");
this.Close();
}
else if (HasRows == false) {
MessageBox.Show("Invalid user name, try again!", "Invalid Info");
this.textBox1.Focus();
this.textBox1.Text = "";
this.textBox2.Text = "";
}
else {
MessageBox.Show("Invalid password, try again!", "Invalid Info");
this.textBox2.Focus();
this.textBox2.Text = "";
}
}
Thanks in Advance.
Is this chair taken
|
|
|
|
|
Hi
It seems like you are looking for the indexer operator under the VB.
In order to read the field values use one of the following methods:
1.indexer operator - dr["Password"] or dr[index]
2.GetValue - dr.GetValue(index)
3.GetValues - int count = dr.GetValues(object[] results)
|
|
|
|
|
I require a drill-down feature in one of my application (exactly similar to Data Tips in Visual Studio .NET 2005).
Here's a brief on what I have:
1. I receive the final output through several steps (say 5 steps) and I need to display the output at each step.
2. Each sub-output has different number of parameters (or you can say No. of Columns)
Considering this, I think something like Data Tips would be the best option for presenting this data to the user.
Problem is that I don't know how to re-create or derive this existing Visual Studio's feature. I am a beginner in C#. I searched everywhere, but all I got was DebuggerVisualizer (which works only in debug mode of Visual Studio and they are not about creating Data Tips).
I want Data Tips to work outside of Visual Studio, in my own application.;)
|
|
|
|
|
i want to make a schedule for distributing employees over a month ,using genetic algorithm & C#
can anyone tell me plz how to proceed ?
|
|
|
|
|
I would say that to proceed, you should do the following:
- 1. Understand genetic algorithms
- You can do that by reading the Wikipedia entry[^] or a good tutorial[^].
- 2. Figure out an acceptable encoding
- The hardest part of genetic computing comes from creating an encoding that represents the appropriate information on which the algorithm can act.
- 3. Write some code
- You can always use Google to find example code.
Unfortunately, this may be all that you get. This sounds suspicious like a homework assignment; we don't do homework for people.
"we must lose precision to make significant statements about complex systems."
-deKorvin on uncertainty
|
|
|
|
|
Hi, This provides usefull methods to get tempfiles, unuque name, and temp directory paths, i m wondering if i can show my files let say in folder "PDF", which is not publicaly viewable, in that temp file, which is unique for each user session.
Problem: I have pdf files in PDF folder on which each asp.net user have different rights, some can view the same files and some can not, so i planned to make it restricted for all user, and will get rights from the dataabse, and finally i want to copy these file to uniquly created temp file, and want to redirect to that file, so user can see the file in browser. i hope you understand my question.
many thanks
adnan
-- modified at 10:39 Sunday 26th August, 2007
Many Thanks,
Adnan Rafiq
muhammadadnanrafiq@gmail.com
|
|
|
|
|
Hi Adnan,
You might find copying the files around will give poor performance, its probably not the best solution to your problem.
It seems the root cause of your problem is that ASP.Net permissions don't apply to passive content like PDFs, am I correct?
If so you might want to read up on how to stream a file using a handler (ashx). You could then have a URL like "http://mysite/viewPDF.ashx?somefile.pdf". If you want a normal looking URL to hide what you are doing you will have to read about URL remapping.
Have a search on this site, theres lots of articles about those topics.
Cheers,
|
|
|
|
|
Thanks for reply. But now i am confused to go for a reliable solution regarding file security.
Its right that asp.net location tag didnot work for like it did work for common aspx pages.
I read articles which advocates different solutions, like implementing basic authentication with SSL, to secure the files, and use httpwebrequest type classes to get login on the server and give access to the logined user without prompting a login diaglue.
Some advocate NTLM security, which is new even i heard first time.
You told me to write handelers, i read a little about it, to map IIS extensions with asp.net extension to restrict file access in browser.
But my real problem is i will be having thousands of files, and with hunderd of users having different writes on them, I am looking to having a reliable solution which should also be good in performance.
Can you please put little more light regarding my context explained above.
I will be very thankful to you.
Many Thanks & Best Regards,
adnan
Many Thanks,
Adnan Rafiq
muhammadadnanrafiq@gmail.com
|
|
|
|
|
Hi Adnan,
A handler can be made that will serve out many different files. I'm not going to write one for you, but I can give you some code snippets to give you an idea. (I'm also typing straight into the reply window, so they might be a little wrong).
Firstly you would need some way of identifying what file the user wants, and mapping that to a real file. Lets just assume they are all pdf files in one directory, and the user will ask for them by filename in the querystring (http://yoursite/getFile.ashx?SomeFileName).
So in our handler we can get the file the user wants with the Request.QueryString. Then we can check whether the user has permission to access the file (how you do this is up to you). Then we can send the file to the client.
We want to set the context.Response.ContentType = "text/pdf" (or whatever is appropriate).
We need to find the physical filename of the file, say string filename= "c:\\somedirectory\\" + filename + ".pdf". Then we can use context.Response.WriteFile(filename) to send the file to the client.
Note that you probably want to check the user's input more carefully than I have.
|
|
|
|