Skip to content

C#

C# discussions

This category can be followed from the open social web via the handle c-065f1d12@forum.codeproject.com

93.7k Topics 383.1k Posts
  • C#, COM, ASP and .NET... LOST

    csharp question java wcf com
    2
    0 Votes
    2 Posts
    0 Views
    J
    If you are using ASP.NET, the recommended way to structure your application is to let it use x-copy deployment (ie you should just be able to copy the files to a new server and it will work). With that said there are a couple different options available. Create a class library in C# that contains all of the code that would have been placed in MTS. Place this dll in the /bin directory of every application that needs it then it will be loaded when referenced by the ASP.NET pages. Create a separate web application that exposes your class library from above as a web-service, then use the webservice from your ASP.NET pages. I'm not sure but Professional ASP.NET programming might cover what you are looking for in both cases. A simple example of the first case is covered in the Beginning version of the book. James Sonork ID: 100.11138 - Hasaki "I left there in the morning with their God tucked underneath my arm their half-assed smiles and the book of rules. So I asked this God a question and by way of firm reply, He said - I'm not the kind you have to wind up on Sundays." "Wind Up" from Aqualung, Jethro Tull 1971
  • WebBrowser

    question html
    2
    0 Votes
    2 Posts
    0 Views
    J
    You could create your own web browser control; but you'd be in for an awful lot of work. For an idea of the amount of work take a look at the Mozzila project. Why not just use the AxWebBrowser control? There's even an article on doing just that: Using the WebBrowser control in .NET James Sonork ID: 100.11138 - Hasaki "I left there in the morning with their God tucked underneath my arm their half-assed smiles and the book of rules. So I asked this God a question and by way of firm reply, He said - I'm not the kind you have to wind up on Sundays." "Wind Up" from Aqualung, Jethro Tull 1971
  • How to get a list of databases in .NET

    csharp database help tutorial
    2
    0 Votes
    2 Posts
    0 Views
    L
    I know how to get the list of database, but list of SQL servers. It's simply just the following query statement SELECT name FROM sysdatabases sysdatabases is located in Master Database. Please let me know when you get the list of SQL servers :)
  • MemDC replacement?

    csharp graphics performance help question
    2
    0 Votes
    2 Posts
    0 Views
    Z
    Where's the dang delete button? ControlStyles.DoubleBuffering
  • SOAP serialization is too slow to accept

    xml csharp database wcf json
    5
    0 Votes
    5 Posts
    0 Views
    J
    What you have is not SOAP, since SOAP is a specialized version of XML; but thats a minor detail. What is happening is the .NET framework is creating a class at runtime to serialize the data. This is why after the first time you serialize the class there is a delay; it is creating and compiling code then caching it away. If speed is that incredibly important search through the DOTNET mailing list archives and see if anyone had figured out how to keep that serializer class after the program has run. I remember some people working on it, they had gotten pretty far with it too. I do not remember when the discussion about it was, but I know it has been since early February. Hope that gives you some idea what is going on :) Just out of curiosity do you see the speed problem with the SOAP formatter? IIRC the SOAP formatter just uses reflection to generate the packet rather than creating a class at runtime. James Sonork ID: 100.11138 - Hasaki "I left there in the morning with their God tucked underneath my arm their half-assed smiles and the book of rules. So I asked this God a question and by way of firm reply, He said - I'm not the kind you have to wind up on Sundays." "Wind Up" from Aqualung, Jethro Tull 1971
  • How can i get the local time?

    question csharp
    3
    0 Votes
    3 Posts
    0 Views
    L
    Thank you. Then i can get the time cost in my work...
  • Filter Dataview

    question
    7
    0 Votes
    7 Posts
    0 Views
    M
    ya,thats it;) Mazy "So,so you think you can tell, Heaven from Hell, Blue skies from pain,... How I wish,how I wish you were here." Wish You Were Here-Pink Floyd-1975
  • CLI available at MSDN site

    csharp com
    4
    0 Votes
    4 Posts
    0 Views
    J
    Kannan Kalyanaraman wrote: What is the Anakrino is it a decompiler of some sort .. can u give me the url.I searched in google but couldnt get any direct link. Anakrino formerly exemplar :) James Sonork ID: 100.11138 - Hasaki "I left there in the morning with their God tucked underneath my arm their half-assed smiles and the book of rules. So I asked this God a question and by way of firm reply, He said - I'm not the kind you have to wind up on Sundays." "Wind Up" from Aqualung, Jethro Tull 1971
  • Coding Standard and Code Review

    csharp question code-review
    3
    0 Votes
    3 Posts
    0 Views
    K
    Well, you can use the official .Net Design Guidelines as a starting-point. http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpgenref/html/cpconnetframeworkdesignguidelines.asp Kevin
  • Dynamic C# dll components?

    tutorial csharp com windows-admin question
    6
    0 Votes
    6 Posts
    0 Views
    F
    Thanx, I'll look into it right now :)
  • Using resources

    csharp graphics question learning
    3
    0 Votes
    3 Posts
    0 Views
    L
    No, it doesn't. What is required here is a namespace: This is an example from Mr. Petzold: Icon=new Icon(typeof(ProgramWithIcon),"ProgramWithIcon.ProgramWithIcon.ico"); The first argument of the constructor refers to ProgramWithIcon class. Within that type operator, you can use the name of any class that your program defines. Or you can use the name of any structure, enumeration, interface, or delegate that you program defines. In any code in the ProgramWithIcon class, the expression: typeof(ProgramWithIcon) is equivalent to: GetType() This equivalence means that you can use the somewhat shorter constructor: Icon=new Icon(GetType(),"ProgramWithIcon.ProgramWithIcon.ico"); And the program still works the same. The second argument to the Icon constructor is more or less a filename. If you named the icon MyIcon.ico, the Icon constructor would look like this: Icon=new Icon(GetType(),"ProgramWithIcon.MyIcon.ico"); The first part of the quoted name is called a namespace, but it’s a resource namespace. Don’t confuse it with the .NET Framework namespace. By default, Visual C# .NET gives this resource namespace the same name as the project, but you can change it. It’s the field labeled Default Namespace in the Property Pages dialog box for the project. The name in that field must agree with the first part of the quoted name in the Icon constructor. You can even set Default Namespace field to nothing, in which case the second argument to the Icon constructor is just the bare filename: Icon=new Icon(GetType(),"ProgramWithIcon.ico"); or MyIcon.ico or whatever you’ve named the file. If you’re running the C# compiler from the command line, you use the /res switch for each resource. For example, if you use the compiler switch: /res:ProgramWithIcon.ico you load the icon like so: Icon =new Icon(GeType(),”ProgramWithIcon.ico”); Or you can give the icon an extended name following the filename and a comma: /res:ProgramWithIcon.ico,ProgramWithIcon.ProgramWithIcon.ico You then use the constructor: Icon =new Icon(GeType(),”ProgramWithIcon. ProgramWithIcon.ico”); to load the icon. Here’s a problem you might run into if you just use the default resource namespace name that Visual C# .NET assigns to your project: Suppose you create a new project named ProgramWithIconPlus in which the ProgramWithIconPlus inherits from the ProgramWithIcon class. In the ProgramWithIconPlus project, you create a new file named ProgramWithIconPlus.cs and you also add a link to the existing ProgramW
  • howto create doc/view c#-apps?

    csharp visual-studio c++ tutorial question
    6
    0 Votes
    6 Posts
    0 Views
    R
    ;P sure? really? :laugh: what do you think i did that day? go and cry? i did code the thing myself - but if there is already a wheel invented, you don't have to do it again and again... right? ;) :wq
  • How I can generate a 5-digit ID in C#

    csharp question
    4
    0 Votes
    4 Posts
    0 Views
    N
    I am still pretty new to C#, but on a hunch I would check out the Random class... :rolleyes:
  • User Control problems...

    help csharp winforms testing beta-testing
    6
    0 Votes
    6 Posts
    0 Views
    N
    Let me guess, The path that you built the control in, contains a # symbol. I ran into that a few days ago. What a pisser...
  • backup

    question
    4
    0 Votes
    4 Posts
    0 Views
    J
    I don't have anything premade but I can come up with a general solution that will need a little tweaking :) [Serializable()] public class BackupFile : ISerializable { private string _filename = ""; private byte[] _filedata = null; public string Filename { get { return \_filename; } set { \_filename = value; } } public byte\[\] FileData { get { return \_filedata; } set { \_filedata = value; } } // Don't allow default constructor use private BackupFile() { } public BackupFile(string filename) { Filename = filename; FileData = null; } public BackupFile(SerializationInfo info, StreamingContext context) { byte \[\] tempB = new byte\[1\]; Filename = (string) info.GetValue("filename", typeof(string)); FileData = (byte\[\]) info.GetValue("filedata", temp.GetType()); WriteFileToDisk(); FileData = null; // "free" the memory used by the file } public void GetObjectData(SerializationInfo info, StreamingContext context) { FileData = LoadFileFromDisk(); info.AddValue("filename", Filename, Filename.GetType()); info.AddValue("filedata", FileData, FileData.GetType()); FileData = null; // "free" the memory used by the file } private void WriteFileToDisk() { // Open the file specified by Filename and write the bytes stored in // FileData to it } private void LoadFileFromDisk() { // Open the file specified by Filename and copy the data from the stream // to FileData } } Now you may wish to also offer compression as well, there is a .NET implementation of gzip/zip available at ICSharpCode.NET. The compression library is GPL, but there is an exception that reads "As a special exception, if you link this library with other files to produce an executable, this library does not by itself cause the resulting executable to be covered by the GNU General Public License. This exception does not however invalidate any other reasons why the executable file might be covered by the GNU General Public License." James [Edit: AHA! I finally figured out how to get the "extra" linebreaks to appear... They can't be blank lines :) Each "blank" line needs a space on it. Pardon me while I celebrate :jig:] Sonork ID: 100.11138 - Hasaki "I left there in the morning with their God tucked underneath my arm their half-assed smiles and the book of rules. So I asked this God a question
  • C# Process "exited" event

    csharp question
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • Wierd collection problem

    help question
    2
    0 Votes
    2 Posts
    0 Views
    A
    I suggest you get ColGen2 from gotdotnet.com It's a collection generator that does all this for you.
  • Complex configuration files

    question workspace
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • how to preserve background after invalidate?

    csharp tutorial question announcement
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • Associated Files

    csharp com question
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied