|
jtmtv18 wrote:
if(LoadFileOnStart.ToLower().EndsWith("rtf")|LoadFileOnStart.ToLower().EndsWith("doc")){
using (StreamReader r = new StreamReader(LoadFileOnStart,System.Text.Encoding.Default)){
MainTextArea.Rtf = r.ReadToEnd();
r.Close();
}
}
if(LoadFileOnStart.ToLower().EndsWith("rtf")|LoadFileOnStart.ToLower().EndsWith("doc"))
{
using (Stream r = File.OpenRead(LoadFileOnStart)){
MainTextArea.LoadFile(r, RichTextBoxStreamType.RichText);
r.Close();
}
}
?
Who is this miscrosoft, and what devilish plans have they for us?
|
|
|
|
|
Can anyone recommend a fast way to send large files to a webservice?
To my knowledge DIME does support chunking, but proxy service and SOAP do
not automatically. I think the solution here is to chunk files into
DIME records and then modify each SOAP message to append the record as an
attachment. I couldnt find any sample code, but the article below
discusses the modifying the soap envelope to add the dime record.
Is there other ways for the WSDK or SOAP3.0 make multiple HTTP calls for each record within a single DIME message?
Id be interested in any other comments on this ..
-- Ingram
http://www.microsoft.com/indonesia/msdn/insidewsepipe.asp#insidewsepipe_topi
c6[^]
Ingram Leedy
You can't depend on your eyes when your imagination is out of focus.
--Mark Twain
|
|
|
|
|
I've just started playing with c# and created a simple control which inherits the textbox control.
I can hide all properties relating to multilines as the control will never do this, by overriding the property and setting [Browsable(false)].
My question is, is there a way to also stop intellisense picking up these hidden properties, eg
usrTextBox.AcceptsTab cannot be seen on the properties page but can be pickup up within the body of the code using usrTextBox.?????
Thanks
Steve Graham
|
|
|
|
|
Is it possible to tell if a control is being designed by the windows form designer? As i will need to render it differently in that situation.
1001111111011101111100111100101011110011110100101110010011010010 Sonork | 100.21142 | TheEclypse
|
|
|
|
|
|
looks like a case of deja vu...the matrix must have changed something
1001111111011101111100111100101011110011110100101110010011010010 Sonork | 100.21142 | TheEclypse
|
|
|
|
|
Hello,
I'm new to C#.NET programming and I have little knowledge on C++. I'm trying to write a project which will convert a decimal number to hex and hex to decimal. I tried "Convert.ToInt" but couldn't get the result.
If anyone would help me about this problem, I would be appreciate it very much.
Thanks!
|
|
|
|
|
This should work:
string ToHex(int number)
{
return number.ToString("X");
}
int FromHex(string number)
{
return int.Parse(number,
System.Globalization.NumberStyles.HexNumber);
}
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
|
|
|
|
|
Anyone know of one?
cheers,
Chris Maunder
|
|
|
|
|
|
I've got one that I wrote a while ago using straight C++ so I was thinking of porting either it or Tidy - but was hoping someone else had done the legwork before me.
cheers,
Chris Maunder
|
|
|
|
|
Chris Lovett posted a C# SGML reader to GotDotNet a while back:
http://www.gotdotnet.com/userarea/keywordsrch.aspx?keyword=SgmlReader[^]
"SgmlReader is an XmlReader API over any SGML document. A command line utility is also provided which outputs the well formed XML result. HTML is an SGML grammar, so you can use this tool to convert HTML into well-formed XML."
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
|
|
|
|
|
Nope, but have considered writting one.
Fear not my insanity, fear the mind it protects.
|
|
|
|
|
Hi All,
I am working on a C# based Windows application.Using the following code
to
create an Excel object.
Excel.Application ExcelObj = new Excel.Application();
Its workin fine for me, the problem is that i want to destroy this
object
when i exit form my method.
I am not able to delete this object.
Calling GC.Collect() Or MArshal.ReleaseComObject() waz not of any help.
Pls help.
Regards
Vitesh
|
|
|
|
|
Here is a code snippet from a class I'm using to export some data from an excel sheet. I think it answers your question.
private Excel.ApplicationClass m_objExcel = null;
private Excel.Workbooks m_objBooks = null;
private Excel._Workbook m_objBook = null;
private Excel._Worksheet m_objSheet = null;
private Excel.Range m_objRange = null;
private object oMissing = System.Reflection.Missing.Value;
try
{
FileInfo inf = new FileInfo(excelFileName);
m_objExcel = new Excel.ApplicationClass();
m_objExcel.Visible = false;
m_objBooks = m_objExcel.Workbooks;
m_objBook = m_objBooks.Open(inf.FullName, oMissing, oMissing,
oMissing, oMissing, oMissing, oMissing, oMissing, oMissing,
oMissing, oMissing, oMissing, oMissing, oMissing, oMissing);
m_objSheet = (Excel._Worksheet)m_objBook.Sheets[2];
string transformFileName = string.Format(@"{0}\{1}.cvt",inf.DirectoryName,inf.Name);
m_objSheet.SaveAs(transformFileName,Excel.XlFileFormat.xlTextWindows,oMissing,oMissing,oMissing,false,false,oMissing,oMissing,oMissing);
activeFile = new FileInfo(transformFileName);
}
catch(Exception ex)
{
throw ex;
}
finally
{
if( m_objBook != null)
{
m_objBook.Close(false, oMissing, oMissing);
System.Runtime.InteropServices.Marshal.ReleaseComObject (m_objBook);
m_objBook = null;
System.Runtime.InteropServices.Marshal.ReleaseComObject (m_objBooks);
m_objBooks = null;
m_objExcel.Quit();
System.Runtime.InteropServices.Marshal.ReleaseComObject (m_objExcel);
m_objExcel = null;
}
}
ed
Regulation is the substitution of error for chance.
|
|
|
|
|
Hi , ive asked this before , but does ANYONE know how to make a borderless window behave like a tooltip?
meaning , it should not steal focus from the app that shows it (grayout the apps caption)
i need to be able to place controls on the 'tooltip' but they dont need to be able to hold focus , just as long as i can click them and the click events work...
currently im doing some nasty wndproc hack , scanning for the wm_ncactivate message , and setting focus back to the parent window... but this causes the parents caption to redraw , so there is some minor flicker (but still annoying)
any idea?
//Roger
|
|
|
|
|
If you're using Windows 2000 or higher, you can override the CreateParams property, and add WS_EX_NOACTIVATE to the ExStyle property:
class TooltipForm : Form
{
...
protected const int WS_EX_NOACTIVATE = 0x08000000;
protected override CreateParams CreateParams
{
get
{
CreateParams cp = base.CreateParams;
cp.ExStyle |= WS_EX_NOACTIVATE;
return cp;
}
}
}
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
|
|
|
|
|
hmmm.. it dont seem to work ...
using win2k and c# , setting the window to "Topmost=true"
it still steal focus..
//Roger
|
|
|
|
|
Excuse-me for my stupid question, In WebForm, I would like to create a button that allow to open html page.(link with parameter ex: qsdf.asp?Text=tete) in the same browser (and other browser). How can I do that?
-=zoltx=-
|
|
|
|
|
In your event handler for your Button you can Response.Write your javascript code to load a new window and change the location of your current browser. This gives you a dynamic effect.
js references
window.open, href.location
example:
public void OnClickButton1(object sender, EventArgs e){<br />
Response.Write("<javascript>window.open("www.codeproject.com");</javascript> );<br />
<br />
}
Note: code was written from memory, it is meant only for a guide
R.Bischoff | C++
.NET, Kommst du mit?
|
|
|
|
|
Sorry I tested and you code don't work, I modify your in this manner Response.Write("<javascript>window.open(\"www.codeproject.com\"); ")");
but it is not enough..
-=zoltx=-
|
|
|
|
|
how to do the same with C# as scripting language
|
|
|
|
|
I"m curious..
I'm changing settings in my machine.config so my web service runs properly. Problem is .. I can't tell which configuration change is making it work properly. It seems to me like the machine.config file is being cached.
Is it? if so is there a way to prevent it from being cached ?
thks
|
|
|
|
|
Hey there,
When using Form.Close and you try to show the form again, it shows without a Titlebar
How do you close a form knowing that you will want to load the form again at a later stage?
|
|
|
|
|
form.Hide() / form.Show()
or
after Close/Dispose, use new Form().
Who is this miscrosoft, and what devilish plans have they for us?
|
|
|
|