|
Use the eventlog, or create a log file.
|
|
|
|
|
trying to create a generic indexer where the class definition does not have a <T>
psedo code below.
<code>
public myClass{
public T this<T>[ValueType item]{
get{
return null;
}
}
}</code>
other than creating two methods for get and set are there any other solutions? or explinations as to why this would not work
-- modified at 19:07 Friday 28th July, 2006
|
|
|
|
|
You cant use type arguments on property definitions.
|
|
|
|
|
Hi!
Is it possible to redirect the output from Process.Start to a textfile or (even better) a variable?
I'm using Process.Start to invocate ipconfig to get the mac address..
Thanks in advance,
-K
|
|
|
|
|
Use Process Start Info to indicate that the process will redirect its std out, in , and err then on then create a process object with the start info as a parameter. Set event listeners on the process for the 3 streams and viola.
A man said to the universe:
"Sir I exist!"
"However," replied the Universe, "The fact has not created in me A sense of obligation."
-- Stephen Crane
|
|
|
|
|
Bien! Just what I wanted. Thanks a million...
-K
|
|
|
|
|
Process p = new Process();
// Redirect the output stream of the child process.
p.StartInfo.UseShellExecute = false;
//p.StartInfo.RedirectStandardOutput = true;
p.StartInfo.FileName = "ipconfig.exe";
p.StartInfo.Arguments = ("/all");
p.StartInfo.RedirectStandardOutput = true;
p.Start();
p.WaitForExit();
string s = p.StandardOutput.ReadToEnd();
Console.WriteLine(s);
Console.ReadKey();
-K
|
|
|
|
|
Hi,
I am deploying a C# application and along with that, i am also deploying SQL Express. Now i want to create the account for user of that application. Please tell me how can i do that.
Regards,
Wasif Ehsan.
|
|
|
|
|
Hi,
I am having problem in writing the stylesheet using C# code-behind. I have written a code, but it is not affecting my pages. Can any one please tell me how to write... This is the code
/*<![CDATA[*/
#banner { background-image:url../images/banner1.jpg) }
#splash{background-image:url(../images/active_bg.jpg) }
/*]]>*/
and I have written like this....
protected void Page_Init(object sender, EventArgs e)
{
HtmlLink link = new HtmlLink();
link.Attributes.Add("type", "text/css");
link.Attributes.Add("rel", "stylesheet");
link.Href = "~../Css/landing.css";
Page.Controls.Add(link);
HtmlLink linkMain = new HtmlLink();
linkMain.Attributes.Add("type", "text/css");
linkMain.Attributes.Add("rel", "stylesheet");
linkMain.Href = "#banner{ background-image:url(../images/banner1.jpg) }";
Page.Controls.Add(linkMain);
HtmlLink linkSplashButtons = new HtmlLink();
linkSplashButtons.Attributes.Add("type", "text/css");
linkSplashButtons.Attributes.Add("rel", "stylesheet");
linkSplashButtons.Href = "#splash{ background-image:url(../images/active_bg.jpg) }";
Page.Controls.Add(linkSplashButtons);
}
Can anyone please tell me how to write this
Regards
Rukmini
-- modified at 13:27 Friday 28th July, 2006
|
|
|
|
|
I really have no idea what you are trying to do with that code?
Anyway if all you want is a style sheet to affect your page, put this in the markup:
In the header:
<link href="pathToStyleSheet" rel="stylesheet" type="text/css" />
In Body:
<div id="banner">some stuff</div>
<div id="splash">some other stuff</div>
And if you have #banner and #splash in the .css file you load with the <link> tag then the styles will be applied.
-- modified at 13:36 Friday 28th July, 2006
|
|
|
|
|
Sorry ..May be I am not clear in my question
I am working on content management system. It is having a master page,
and all the other aspx pages are having the asp:Content. The content of the aspx pages must appear in the contentplaceholder of the master page. All the aspx pages are having different stylesheets. So for every aspx page I must add the stylesheets in code-behind.
While trying to add the stylesheets from code-behind I am facing problem.
|
|
|
|
|
Ahh I understand now.
Put a Label in the <head> in the MasterPage. Then in the page_load for the .aspx page put something like:
((Label)MasterPage.FindControl("lblStyleSheet")).Text = "<link href='yourStyleSheet.css' rel='stylesheet' type='text/css' />";
|
|
|
|
|
Now this part is working
HtmlLink link = new HtmlLink();
link.Attributes.Add("type", "text/css");
link.Attributes.Add("rel", "stylesheet");
link.Href = "../Css/landing.css";
Page.Controls.Add(link);
the error is..by mistake I have given like this
link.Href = "~../Css/landing.css";
Now for this two I am unable to find out what is the problem.
HtmlLink linkMain = new HtmlLink();
linkMain.Attributes.Add("type", "text/css");
linkMain.Attributes.Add("rel", "stylesheet");
linkMain.Href = "#banner{ background-image:url(../images/banner1.jpg) }";
Page.Controls.Add(linkMain);
HtmlLink linkSplashButtons = new HtmlLink();
linkSplashButtons.Attributes.Add("type", "text/css");
linkSplashButtons.Attributes.Add("rel", "stylesheet");
linkSplashButtons.Href = "#splash{ background-image:url(../images/active_bg.jpg) }";
Page.Controls.Add(linkSplashButtons);
|
|
|
|
|
can anyone please send any intresting miniproject using only c.it should be not too long a maximum of 200lines.waiting 4 reply.plz replysoooooon.
|
|
|
|
|
Sure thing. Here you go. I hope it's not too long. Anything else we can do for you?
void main(){} /ravi
|
|
|
|
|
This is a C# forum, not C.
-Daniel
Typing too fast fro my owngood
|
|
|
|
|
Write your own code or take the FAMOUS PROGRAM IN THE WORLD :
Console.WriteLine("Hello World");
|
|
|
|
|
Hi,
I am deploying a c# database with which i am also deploying SQL express. I need to deploy database after installation as well. I have the .mdf file. I want to know how can i place the .mdf in the appropriate folder. ( And also which folder is apporpriate for this purpose).
Regards,
Wasif Ehsan.
|
|
|
|
|
This would be better in the SQL forum, but here you go... my company does this and distributes the .mdf file and then runs a SQL script to attach to the database. I think it is a better solution to build a SQL script for the database and have it create the tables, stored procedures, etc instead of distributing the .mdf file. But if you must, you can put the .mdf file anyplace on the drive and use the sp_attach_db stored procedure.
sp_attach_db @dbname = 'Pat',
@filename1 = 'C:\db\Pat.mdf',
@filename2 = 'C:\db\Pat_log.ldf'
Steve Maier, MCSD MCAD MCTS
|
|
|
|
|
Hi
Is it possible to show different image in one column in each row depending on status of other column in the grid?
For example:
stop o
running ~
waiting x
I wouldn't like to create my own class representing ImageCell. Just using CellPainting event.
I do like this in CellPainting:
e.Graphics.DrawImage(img, e.CellBounds);
img depends on value of another column (status)
...but it doesn't work. Image is drawn and disappears
Thanks
Ela
|
|
|
|
|
e_LA wrote: Image is drawn and disappears
It's hard to help you without seeing the context of the drawing code. If it's drawn but then disappears, either you're drawing code is wrong or you're drawing in the wrong place.
|
|
|
|
|
Ok
When I put only such a code in cellpainting event
private void myDataGridView_CellPainting(object sender, DataGridViewCellPaintingEventArgs e)
{
if (e.ColumnIndex > -1 && e.RowIndex > -1)
{
Image img = global::MyApplication.Properties.Resources.GreenImage;
e.Graphics.DrawImage(img, e.CellBounds);
}
}
Anything is drawn. Why?
In fact it is drawn and dissapears - I checked it.
What is wrong?
|
|
|
|
|
Instead of setting up a CellPainting handler, define a DataGridViewCell type and override the Paint method, then put your painting code inside that overridden method.
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Messianic Instrumentals (with audio)
The apostle Paul, modernly speaking: Epistles of Paul
Judah Himango
|
|
|
|
|
What is a difference between overriding the Paint method and setting up a CellPaining handler?
Can I define a DataGridViewCell type and add it to an existing column?
Thanks for help
Ela
|
|
|
|
|
Ok I defined my own class representing column and cell class where I overriden a Paint method.
In the Paint method I would like to draw image depending on value of another column.
I have to take DataSource (DataView) where I could check the value in another column in the same row (RowIndex).
That's why I created cell constructor like that
public ImageCell(DataGridView dGridV)
{
this.grid = dGridV;
}
When in Paint method I put such a line
DataView dv = (DataView)grid.DataSource;
I have an exception because grid is null.
I think during adding column to grid operation default constructor of the cell is called (which is empty in my case). Am I right?
Thanks
Ela
|
|
|
|