|
are you using the "file" protocol? Like
Best regards,
Jaime.
|
|
|
|
|
That doesn't seem to work either.
I also just found out that I can't load/apply an external stylesheet...
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
modified on Saturday, October 4, 2008 6:13 AM
|
|
|
|
|
John Simmons / outlaw programmer wrote: I also just found out that I can't load/apply an external stylesheet
That's not true, you can use stylesheets in local html files.
Maybe you have not described your problem clearly.
Best regards,
Jaime.
|
|
|
|
|
I didn't say the control couldn't. I was saying I can't get it to. Here's the code:
private string BuildHtml()
{
StringBuilder builder = new StringBuilder("");
builder.Append("<html>");
builder.Append("<head>");
builder.AppendFormat("<base href='{0}' />", Application.StartupPath);
builder.Append("<style>");
builder.Append("body { font-family:arial; font-size:11pt; }");
builder.Append(".articleTable { width:100%; border:0; background-color:Black; ");
builder.Append(" font-family:arial; font-size:11pt; }");
builder.Append(".darkRowChanged { background-color:#B1E3FF; }");
builder.Append(".lightRowChanged { background-color:#E5F6FF; }");
builder.Append(".darkRow { background-color:#EEE; }");
builder.Append(".lightRow { background-color:white; }");
builder.Append(".descText { font-size:9pt;color:#777;margin-top:3; }");
builder.Append(".titleText { font-weight:bold; font-style:italic; }");
builder.Append(".headerRow { background-color:#999; height:20px; line-height:20px; }");
builder.Append(".dataRow { height:60px; }");
builder.Append("</style>");
builder.Append("</head>");
builder.Append("<body>\n");
builder.Append("</body>");
builder.Append("</html>");
return builder.ToString();
}
this.webBrowser1.Navigate("about:blank");
HtmlDocument doc = this.webBrowser1.Document;
doc.Write(string.Empty);
this.webBrowser1.DocumentText = BuildHtml();
I've also tried the following to get the file:
href="./cpam.css"
href="c:\fully\qualified\path\cpam.css"
I have a feeling that if I can find out why either images won't display or the css file won't load, the whole thing will fall into place. I simply don't know what I've missed here, and finding info with google on this problem is impossible because of the lack of documentation anywhere concerning the webbrowser control.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
again, you should try with the file protocol:
href="file://c:\fully\qualified\path\cpam.css"
Best regards,
Jaime.
|
|
|
|
|
I *did* try that and it didn't work.
Everything I've managed to find on the web says that the normal DOS path should work, and nobody else has mentioned the "file://" thing.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Few ideas:
- when you used Application.StartupPath , did you place the css-file in your projects \bin\Debug-directory, not in the project directory?
- you can try using / as directory separator instead of \
- most html-files use double quotes for href's like href="..." so that would be also worth trying.
The need to optimize rises from a bad design
|
|
|
|
|
Ya know, a lot of people wouldn't come back to a thread like this simply to admit that they were an idiot... But I was an idiot.
I was copying the files in question to the WRONG debug folder.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
I'm trying to correctly write the stream data to control.
Response.Write(stmDetailData = DWGControl);
Full event code:
protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)
{
Control DWGControl = FindControl("dwgViewerCtrl");
const string sql = "SELECT Detail_ID, Detail_DWG from Detail_Info";
try
{
using (System.Data.SqlClient.SqlConnection cn = new System.Data.SqlClient.SqlConnection(ConfigurationManager.ConnectionStrings["DetailsDBFConnectionString3"].ConnectionString))
cn.Open();
using (System.Data.SqlClient.SqlCommand cmd = new System.Data.SqlClient.SqlCommand("SELECT Detail_ID, Detail_DWG from Detail_Info"));
System.Data.SqlClient.SqlDataAdapter da = new System.Data.SqlClient.SqlDataAdapter();
DataSet_Details ds = new DataSet_Details();
da.Fill(ds, "DetailInfo");
int c = ds.Tables["DetailInfo"].Rows.Count;
if (c > 0)
{
Byte[] byteDetailData = new Byte[0];
byteDetailData = (Byte[])(ds.Tables["DetailInfo"].Rows[c - 1]["Detail_dwg"]);
System.IO.MemoryStream stmDetailData = new System.IO.MemoryStream(byteDetailData);
Response.Write(stmDetailData = DWGControl);
}
cn.Close();
}
catch (Exception ex)
{ MessageBox.Show(ex.Message); }
}
|
|
|
|
|
I don't understand your line:
Response.Write(stmDetailData = DWGControl);
I think it should be instead:
Response.ContentType = "application/dwg";
Response.BinaryWrite(stmDetailData.ToArray());
Best regards,
Jaime.
|
|
|
|
|
first thanks for evryone help others in this website
i would like to compare between tow datetime and get the deffrance between them in hours
example
in parking we get the entrance datetime and leave datetime
i want to compare tow datetime and get the real hours of parking
MD_NADA
|
|
|
|
|
TimeSpan ts = dateTime1 - dateTime2;
Console.WriteLine(ts.TotalHours);
|
|
|
|
|
You should look into the TimeSpan object.
TimeSpan timeSpan = DateTime.Now.Subtract(new DateTime(2008, 10, 3));
To get the whole number of hours, its as simple as int hours = timeSpan.Hours
If you want to get the total hours, double totalHours = timeSpan.TotalHours
If you're unclear on any of this I recommend taking a look at the documentation or doing a google search on System.TimeSpan
|
|
|
|
|
Have been trying up an easy program, but now want to try make it more user friendly by maybe playing a song in the background. How can I go about this one.Anyone help please.(C# base).
|
|
|
|
|
It depends on how you want to do it. The simplest way is:
System.Media.SoundPlayer soundPlayer = new System.Media.SoundPlayer();
soundPlayer.SoundLocation = @"c:\chord.wav";
soundPlayer.Play();
Don't forget to call soundPlayer.Dispose() when you're finished with it!
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)
|
|
|
|
|
Thanks alot that helped and am able to get through.could have kissed you if you were next to me.(just a jok)
Now check here, that method can only work with .wav file type only? or you can use other files(file size for a wav file is too large).
waiting....
Thanks alot
|
|
|
|
|
IT would have taken less time to change your code to point to an .mp3 file than it did to post the question here.
Today's lesson is brought to you by the word "niggardly". Remember kids, don't attribute to racism what can be explained by Scandinavian language roots.
-- Robert Royall
|
|
|
|
|
You may be better off embedding media player. Right click on your toolbox and select Chose Items (you may have to wait a while for the next dialog!). Click on the COM Components tab and scroll down and select Windows Media Player.
Drag and drop (& resize) a WMP onto your form. Set the URL property to point to your file and you're done.
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)
|
|
|
|
|
Sounds user hostile to me.
|
|
|
|
|
What's that supposed to mean?
|
|
|
|
|
The user may not want sound playing.
|
|
|
|
|
I have a program that allows the user to multi-select categories. The control is bound to a dataset table. When the user clicks the get data button, I have to pass the selected categories to a SQL Server stored procedure and limit products to the select categories.
The data is in a table in memory. I know I can loop through the rows of the data table and create some sort of a list and pass it as a varchar(max) parameter to the Store Procedure and parse it. Is there a more efficient method? A method that does not involve looping.
|
|
|
|
|
you are doing a your way thing i don´t imagine what it is.
i think you are using 1 varchar(max) column instead of 8 whatever columns.
you put all string in that varchar(max) and use "," to separate strings, isn´t thats right?!? so you need to loop to get them after.
i don´t use that, i add more columns and leave some empty if required, but you can do that don´t know if runs faster!
i heard of that in sql forum keep that way it´s ok to me.
nelsonpaixao@yahoo.com.br
trying to help & get help
|
|
|
|
|
************Programming Challenge**********************
Hi All
Again I have spent more than five hours but still fighting.
I just want to type underscore in my windows textbox.I am able to type characters, Hit enter key etc etc but do not yet found how to print underscore and other special characters like @,$,%,^
I have tried following code .Discovered new things but still trying to find the solution
SendKeys.SendWait(Keys.Decimal.ToString());
SendKeys.SendWait(Keys.S.ToString());
SendKeys.SendWait(Keys.A.ToString());
SendKeys.SendWait(Keys.N.ToString());
SendKeys.SendWait(Keys.D.ToString());
SendKeys.SendWait(Keys.E.ToString());
SendKeys.SendWait(Keys.Oem1.ToString());
SendKeys.SendWait(Keys.Oem102.ToString());
SendKeys.SendWait(Keys.Oem2.ToString());
SendKeys.SendWait(Keys.Oem3.ToString());
SendKeys.SendWait(Keys.Oem4.ToString());
SendKeys.SendWait(Keys.Oem5.ToString());
SendKeys.SendWait(Keys.Oem6.ToString()); // with this type of code getting Oem6 in
// textbox but i wanted 6.
SendKeys.SendWait(Keys.Oem7.ToString());
SendKeys.SendWait(Keys.Oem8.ToString());
SendKeys.SendWait(Keys.OemClear.ToString());
SendKeys.SendWait(Keys.OemBackslash.ToString());
SendKeys.SendWait(Keys.OemCloseBrackets.ToString());
SendKeys.SendWait(Keys.Oemcomma.ToString());
SendKeys.SendWait(Keys.OemMinus.ToString());
SendKeys.SendWait(Keys.OemOpenBrackets.ToString());
//with this code getting OemOpenBrackets in textbox but desired was (.
SendKeys.SendWait(Keys.OemPeriod.ToString());
SendKeys.SendWait(Keys.OemPipe.ToString());
SendKeys.SendWait(Keys.Oemplus.ToString());
SendKeys.SendWait(Keys.OemQuestion.ToString());
SendKeys.SendWait(Keys.OemQuotes.ToString());
SendKeys.SendWait(Keys.OemSemicolon.ToString());
SendKeys.SendWait(Keys.Oemtilde.ToString());
SendKeys.SendWait("{OemSemicolon}"); //givin error
SendKeys.SendWait(Keys.KeyCode== 106); //giving error
SendKeys.SendWait(Keys.E.ToString());
SendKeys.SendWait(Keys.P.ToString());
SendKeys.SendWait(Keys.U.ToString());
SendKeys.SendWait(Keys.K.ToString());
SendKeys.SendWait(Keys.A.ToString()); //working fine
SendKeys.SendWait(Keys.L.ToString());
SendKeys.SendWait(Keys.R.ToString());
SendKeys.SendWait(Keys.A.ToString());
SendKeys.SendWait(Keys.NumPad5.ToString()); //
//with this type of code getting NumPad5 in textbox desired was 5
SendKeys.SendWait(Keys.NumPad4.ToString());
SendKeys.SendWait("{Enter}"); //working fine
Any studymaterial ,sample application or anything related to this will help.I am also trying to find .
Thanks in advance
THE SK
I am the ONE
|
|
|
|
|
Hi All
Finally got it on below link
http://msdn.microsoft.com/en-us/library/8c6yea83(VS.85).aspx
The correct way is
SendKeys.SendWait("{+}"); //for typing plus
SendKeys.SendWait("{_}"); //for typing underscore
For this spent more than five hours ... great
THE SK
I am the ONE
|
|
|
|