|
:-Dtry the most nice thingthe i tried before the Thread.Sleep(int milli second);
it is really good for animating colors and texts but don't try to use it in the current thread try to no use it long time
ByMindOnlyYouCanDoIt
|
|
|
|
|
i have searched in dot netframework classes to find the classes to restart or shutdown computer but i didnt find any usefull class to do that anybody who knows plz help me. tax
m.rastgar
|
|
|
|
|
m.rastgar wrote:
i have searched in dot netframework classes to find the classes to restart or shutdown computer but i didnt find any usefull class to do that anybody who knows plz help me.
I don't know of any .NET Framework class either but you could simply call ExitWindowsEx()[^] (see also ExitWindowsEx() [pinvoke.net][^]).
Best regards
Dennis
|
|
|
|
|
try to do it by lanching a batch file have this command (shutdown -s)
and to do the code of lanching by C#
ByMindOnlyYouCanDoIt
|
|
|
|
|
Hello I've a software written in Java with some compiled DLL's. Now I want to convert it to C#. As Far as my java code is concerned i'll translate it into C# what abt the DLLs. Can i use Dlls written of Java in C#? Please help me.
Regards
|
|
|
|
|
You might be able to IKVM.
http://www.ikvm.net/[^]
Also if you convert the java dll to a .net dll then you can use reflector to generate C# code for the dll, assuming the license allows you to do that.
I can imagine the sinking feeling one would have after ordering my book,
only to find a laughably ridiculous theory with demented logic once the book arrives - Mark McCutcheon
|
|
|
|
|
can u guide me how to convert a java Dll in C# plzz:$ and how to use reflecter:$
Thnkxx alot
|
|
|
|
|
Well, C# virtually IS JAva, I don't see what the problem is.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
I am looking for suggestions of best practices on where/how to store a database password that allows the application to open the database. It is not recommended storing it in the application, especially since .NET can be de-compiled.
|
|
|
|
|
sn dont permit that the code is dissambled
store a password in a exe file is wrong,but if you store the pass crypted, and in exe make an function that decrypt the pass like ASP
|
|
|
|
|
|
|
This would be more like a file based database like Acess that is installed on individual desktops.
|
|
|
|
|
I need to loop through each row in the web datagrid that has bound columns
can some one help me with this. ?
based upon a value in column 4 of the datagrid I need to change the back color of that row, and then move to the next row until finished processing all the rows.
thanks
|
|
|
|
|
Do an onitemdatabound handler, then use FindControl to find the item you want to inspect/modify.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
|
The same question, but with a Windows Form DataGrid control?
Thanks,
Enrique.
|
|
|
|
|
Can anyone tell me the best way to do this?
Form1 has a listview that pulls data from a sql table and displays it in the listview.
From Form1, how can i call a class that would make the SQL connection and run a query that would display my data to Form1?
basically, i have a lot of Forms that individually make a SQL connection, but in the event of having to change SQL servers, i dont want to have to go into all 20 of these forms to change the SQL Connection string to point to a new server.
Form1
-----
<br />
private void listfromDB()<br />
{<br />
string sqlString = "select * from table";<br />
mySQLClass getSQLdata = new mySQLClass();<br />
getSQLdata.SQLdata(sqlString);<br />
<...code to add data from query to listview...><br />
}<br />
Class1
------
<br />
public giveSQLdata(string _sqlString)<br />
{<br />
string sqlCon = "workstation id=LOCALHOST;packet size=4096;...etc";<br />
SqlConnection sqlConnect = new SqlConnection(sqlCon);<br />
SqlCommand cmd = new SqlCommand(_sqlString, sqlConnect);<br />
sqlConnect.Open();<br />
SqlDataReader dr = cmd.ExecuteReader();<br />
return something...<br />
}<br />
i'm new to this and need help...i freely admit this.
thank you so much for your help.
.gonad
|
|
|
|
|
A number of solutions come to mind.
What I normally end up doing is adding information to the app.config or web.config that has the name of the SQL Server. Then in my .NET application (of what ever type) I create a class that I use to access the config file. This class will build a connection object for me based on the contents of the config file.
The class might look something like this:
using System;
using System.Configuration;
using System.Data;
using System.Data.SqlClient;
namespace MyNamespace
{
public class ConfigSettings
{
public static SqlConnection DatabaseConnection;
{
get
{
string server = ConfigurationSettings.AppSettings["SqlServer"];
string database = ConfigurationSettings.AppSettings["Database"];
string connectionString = string.Format("Server={0};Database={1};uid=???;pwd=???", server, database);
return new SqlConnection(connectionString);
}
}
}
}
The corresponding config file will look something like this:
<configuration>
<appSettings>
<add key="SqlServer" value="ServerMachineName" />
<add key="Database" value="Northwind" />
</appSettings>
</configuration>
Does this help?
Do you want to know more?
WDevs.com - Open Source Code Hosting, Blogs, FTP, Mail and Forums Upcoming talk:
SELECT UserName, Password FROM Users
-- Getting unauthorised access to a SQL Server, and how to prevent it.
|
|
|
|
|
Colin Angus Mackay wrote:
Does this help?
Well, even if it doesn't help him, It sure helped me! It's scary how the obvious sometimes escapes me.
Thanks Colin!!
Paul Lyons, CCPL Certified Code Project Lurker
|
|
|
|
|
|
yes!
thank you very much for this. i haven't used the app.config before so this opens a lot of doors for me.
thanks for the insight!
gonad.
|
|
|
|
|
Two general questions...
First, I have SEVERAL system.Diagnostics.process events running in just ONE menu click event, but the thing is that only the FIRST process gets run, while the other processes are ignored. What is the reason for the other processes being ignored? Do I need to implement each of the processes using a multi-threaded approach? If so, is there a good article written on all of the steps required for multi-threading?
Second, I am implementing a C# windows application that accesses several graphics files based upon the menu item that is selected by the user. The problem is that when a different menu item is selected, the graphics items are NOT RELEASED, and thus they cannot be overwritten with graphic file replacements. The error message thrown is that there is a file sharing error. Is there a way that I could somehow RELEASE the graphics programmatically so that there would not be a file sharing error thrown, and if so, what is the syntax?
I would imagine that it would need to use a foreach loop with relation to a directory and would somehow utilize the control.Dispose() method ie.
string strDirectory = System.IO.Directory;
foreach(Control control in strDirectory)
{
control.Dispose();
}
Am I on the wrong track, or is there a way of RELEASING the files so that they are no longer in SHARE MODE so that they could be overwritten? Would appreciate some further assistance.
|
|
|
|
|
new_phoenix wrote:
First, I have SEVERAL system.Diagnostics.process events running in just ONE menu click event, but the thing is that only the FIRST process gets run, while the other processes are ignored.
Without seeing your code that launches all this stuff, it's impossible to tell you what your doing wrong. You should be able to launch any number of processes without spawning them on extra threads.
new_phoenix wrote:
Second, I am implementing a C# windows application that accesses several graphics files based upon the menu item that is selected by the user. The problem is that when a different menu item is selected, the graphics items are NOT RELEASED, and thus they cannot be overwritten with graphic file replacements.
You're running into the issue where if you tell an Image object to load an image from a file, the Image object maintains a lock on that file until the Image object is disposed. To work around this, see this[^] article on MSDN.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Dave Kreskowiak:
Interesting article about graphic file locking using the Image.FromFile() method versus FileStream. Makes me wonder why Microsoft would set up the possibility of creating this issue in the first place. Also, thanks for letting me know that I do not need to go into spawning threads to manage the processes as well. Could the problem of process management be that the first process needs to be killed before it could progress to the next process? Thanks again.
|
|
|
|