|
Hi,
you can get and set the WebBrowser.DocumentText property, hence modify the page any way you like.
you probably will be interested in the Navigating, Navigated and DocumentCompleted events.
|
|
|
|
|
Hi,
My application can now check for all the installed windows service on the local machine.
How can I do this for other machines on the network?
For example, from my machine where the application starts, I would also like to check for the windows service names on OTHER machines.
Please note that I do know how to loop through the names of the windows services but not sure how to connect to other machines to do this.
Thanks
|
|
|
|
|
The System.ServiceProcess.ServiceController.GetServices function is overloaded. Pass the computer name as one of the arguments
|
|
|
|
|
|
add reference : System.ServiceProcess
then call :
ServiceController[] sc = ServiceController.GetServices("MACHINE2");
|
|
|
|
|
I want to learn c# completely.
can anybody suggest me good website for c#?
|
|
|
|
|
|
1. c# is not a good title for your post, every post in this forum is about c#.
2. If you want to learn c# I suggest you read a c# book first. Such as this[^] or this[^]
Giorgi Dalakishvili
#region signature
my articles
#endregion
|
|
|
|
|
|
Hi,
I think that you should first download the absoulte beginners lessons (by bob tubor)in microsoft site. Download the c#, sql server lessons (at least).
Then pratice. If you became stuck in something ask here or search the articles.
Good Luck!!!
|
|
|
|
|
I was thinking we should always deploy app.config file. But accidently I forgot to supply it, but still applications works well. So isn't it necessary to supply app.config file ? I am confused. Any help ?
|
|
|
|
|
app.config contains application configuration used by your program.
If you don't use any config then you don't need it.
Lots of classes in the framework can use app.config to configure their behaviour (Like trace listners and stuff like that). The enterprise library uses app.config heavily to configure how it works. Any application settings using a settings class are stored in the app.config file.
Without the file, most stuff will just reset to default behaviour. Look in it, check what settings you have in their, maybe you don't have any that are actually used.
Simon
|
|
|
|
|
I have 2 applications developed in .net. When I install both these applications in a single system a complete set of dlls are created each in corresponding application folders.
Is it possible to put these dlls in a common folder and make the applications reference them from the same common folder ?
Can this be done using any options in the .net msi project ?
Thanks in advance for any replies & suggestions......
|
|
|
|
|
If same assembly is used in multiple projects, you can deploy it in GAC.
|
|
|
|
|
Hi,
i'm trying to Display a Byte with Bits String Like
byte Temp = 55;
so the displayed string will be : "01010101"
is there a sumple and quick way to do this
THANKS
Have Fun
Never forget it
|
|
|
|
|
Convert.ToString(Temp, 2)
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
THANKS
Have Fun
Never forget it
|
|
|
|
|
Aha! Now I know something new too
Thanks.
|
|
|
|
|
That gives "110111", not "01010101".
|
|
|
|
|
I think that he meant 0x55.
If you want it padded with zeroes, use the PadLeft method:
Convert.ToString(Temp, 2).PadLeft(8, '0')
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
I try not to make assumptions.
|
|
|
|
|
No.
byte b = 55 ;
System.Text.StringBuilder sb = new System.Text.StringBuilder() ;
foreach ( char c in b.ToString() )
{
sb.Append ( System.Convert.ToString ( c - '0' , 2 ).PadLeft ( 4 , '0' ) ) ;
}
System.Console.WriteLine ( sb.ToString() ) ;
|
|
|
|
|
Hi,
I have a simple method that checks if a sheet name is present in the excel file or not. The code is simple and works fine when the sheet name doesn't contain any spaces:
private bool validateExcelSheetByName(string name, OleDbConnection connection) {
bool result = true;
try {
if (connection.State == ConnectionState.Closed)
connection.Open();
var command = new OleDbCommand(string.Format("select * from [{0}]", name), connection);
command.ExecuteNonQuery();
}
catch {
result = false;
if (connection.State == ConnectionState.Open)
connection.Close();
}
return result;
}
In case I have a dot and a space in the sheet name (for example 'My. Sheet'), I get an exception saying:
Invalid bracketing of name 'My. Sheet$'.
I store the sheet name in a variable:
private const string sheetName = "My. Sheet$";
How can I fix this code so it will work when I have dots and spaces in the sheet name?
Thank you!
Andrei
|
|
|
|
|
You can use this code to get the schema.
DataTable dt = oCon.GetOleDbSchemaTable(System.Data.OleDb.OleDbSchemaGuid.Tables, null);
Here, datatable will have a column table_name which contains names of all the sheets in the file.
Hope it helps
|
|
|
|
|
This doesn't help me much... I have multiple sheets in the document and after I see that a certain sheet is present I have to process it:
var command = new OleDbCommand(string.Format("select * from [{0}]", sheetName), connection);
var adapter = new OleDbDataAdapter {SelectCommand = command};
var ds = new DataSet();
adapter.Fill(ds);
connection.Close();
DataTable dt = ds.Tables[0];
foreach (object dr in dt.Rows) {
string[] array = Array.ConvertAll(((DataRow)dr).ItemArray, new Converter<object,>(Convert.ToString));
// continue processing here...
}
So I would still have problems in the case of a sheet name that contains a dot and a space as mentioned in my initial post.
Is there any workaround for this issue?
Thank you!
|
|
|
|