Jump to content
Xtreme .Net Talk

aewarnick

Avatar/Signature
  • Posts

    1052
  • Joined

  • Last visited

Everything posted by aewarnick

  1. I just read a bunch of that faq you posted. It was very good. I will look for what to do with the version numbers and will post back.
  2. and Environment.OSVersion is not specific enouph. For example, I have xp, but it retuns nt and not xp. Nt is not the same as xp in many ways (probably). Does anyone know of any other way to get the operating system?
  3. Do I have to write that whole thing all the time? Why can't I put in up at the top with all the other using's?
  4. I was told that ReadToEnd() was slower than if you put the whole thing into a byte[] and went from there. I think I am having problems, because my method is so much slower than ReadToEnd() is: public static object Read(ref string path) { string g=""; if(File.Exists(path)) { Stream F=new FileStream(path, FileMode.Open, FileAccess.Read); byte[]b=new Byte[F.Length]; F.Read(b, 0, Convert.ToInt32(F.Length)); for(int i=0; i< b.Length; i++) { if(b[i]==0) break; g+=(char)b[i]; } //StreamReader s=new StreamReader(path); //string g= s.ReadToEnd(); //s.Close(); MessageBox.Show(g); F.Close(); } return g; } Why is mine so slow?
  5. I found lots and lots of documentation on how to put an image into a Byte[] using MemoryStream but what about any object? It would be really nice if I could put any object into a Byte[].
  6. Maybe I just don't know what I am doing yet. . .If I don't let me know, please!
  7. That is true. Maybe I am making my class wrong. I am putting all and I mean all of my methods into one class in one dll. I am worried that it may slow the programs down but it may not since all the methods except one are static.
  8. Maybe I will just not use dll and stick with plain source code. Are there any disadvantages to that?
  9. I have a dll called ProgramAW that I made from my class Andrew. I put it in my references and but it only works if I use copy local when I copile it. Is there any way to embed my dll in the program so that I don't have an extra piece with my program or am I stuck with it?
  10. Actually I think I was wrong. . .there SEEMS to be no difference in speed. But, would you say that using a byte[] buffer is the best way to go, Rather than byte by byte?
  11. A question, that was quite slow. Is there any faster way to write it than WriteByte?
  12. You're right divil. That did work. Forget that recource manager. Thank you so much. Why does it have to be so complicated like that? I think MS could have made that alot easier. After all, the object is right there!!
  13. I cannot get anything to work. Do I need to create a new resource file? I don't think so becuase the font is embedded in the program. I know by the size of it.
  14. This is actually closer to what I am trying to do: ResourceManager RM=new ResourceManager(typeof(Form1)); object font= RM.GetObject("verdana.ttf"); MessageBox.Show(""+font.ToString()); BinaryFormatter B=new BinaryFormatter(); B.Serialize(FS, font); FS.Close(); My only trouble is referencing the embedded resource named, "verdana.ttf". I noticed that VS uses the Resource manager to load pictures into picture boxes. I cannot find where the resource is though. For example, my embedded resource is in the solution explorer with all the classes but theirs I cannot find anywhere. This is what is written in the code to load it: this.pictureBox1.Image = ((System.Drawing.Bitmap)(resources.GetObject("pictureBox1.Image"))); How can I make a reference to my embedded resource that is shown in the Solution explorer?
  15. Very frustrated. . . this should not be hard. I have a font as an embedded resource in my program. I think the problem is that I cannot access it to get the size in bytes (if that is possible). I think that I need to put the font into the byte array to write it to disk but I cannot get it's attributes or access it. Here is what I have so far: FileStream FS=new FileStream("C:\\Windows\\verdana.ttf", FileMode.Create, FileAccess.Write); ResourceWriter RW=new ResourceWriter(FS); RW.AddResource("verdana.ttf", "1"); RW.Close(); byte[]b= new Byte[200]; FS.Write(b, 0, 200); FS.Close();
  16. It apparently is not there at all but the space is there!! When I use this I get the error index outside bounds. if((int)e.KeyCode==(int)Keys.Enter) { string n= this.RTB.Text; this.RTB.Text=""; MessageBox.Show(""+(int)n[0]); and there apparently isn't any linefeed at all when I press enter because it does not even enter the if block: if((int)e.KeyCode==(int)Keys.LineFeed) I could not figure out how to grabbing the Enter-Key and setting e.handled = true Can you help me with how to do that?
  17. You know what, my debug and releases are exactly the same, down to the byte...
  18. Those boxes looked alot more like boxes before I posted. You will have to use your vast imagination to see them now. How would I get rid of a Line Feed?
  19. Say this is my box: |--------- || | The line in the box is the curser. | | |______| |--------- | | || | Instead of the curser starting at the top it is there. |______|
  20. Thank you. I forgot I posted this, so please don't answer this part of my other post. I will give a link here from there.
  21. In VS Difference between bin, obj, debug, release? The programs that are made in those folders all seem the same. What is the difference between them and which one do I really need?
  22. Is there any way to get just the operating systems ex: "Windows '95" I have had to use Environment.OSVersion and then chop it up to get just Windows '95.
×
×
  • Create New...