Click here to Skip to main content
15,847,077 members
Home / Discussions / C#
   

C#

 
AnswerRe: Best practice to build localizabled Applications ? Pin
matthias s.1-Feb-03 10:11
matthias s.1-Feb-03 10:11 
GeneralRe: Best practice to build localizabled Applications ? Pin
Chris Richner1-Feb-03 10:38
Chris Richner1-Feb-03 10:38 
GeneralRe: Best practice to build localizabled Applications ? Pin
Chris Richner2-Feb-03 5:24
Chris Richner2-Feb-03 5:24 
GeneralRe: Best practice to build localizabled Applications ? Pin
ian mariano3-Feb-03 13:44
ian mariano3-Feb-03 13:44 
GeneralOleDbDataAdapter and more tables Pin
mkomasi1-Feb-03 7:36
mkomasi1-Feb-03 7:36 
GeneralRe: OleDbDataAdapter and more tables Pin
leppie1-Feb-03 9:01
leppie1-Feb-03 9:01 
Generalall computers in the network Pin
Calamitous1-Feb-03 3:13
Calamitous1-Feb-03 3:13 
GeneralRe: all computers in the network Pin
leppie1-Feb-03 7:17
leppie1-Feb-03 7:17 
Hey I just did one (well a TypeCOnvertor for it) Smile | :)

private string pcname = ".";

[Category("Interface Options")]
[TypeConverter(typeof(ControlOptions.MachineConvertor))]
public string MachineName 
{
   get {return pcname;}
   set {pcname = value;
      sname = value;
   }
}

[DllImport("Netapi32")]
private static extern int NetServerEnum(
   string servername, //must be null
   int level, //101
   out int buffer,
   int maxlen, //out
   out int entriesread, //out
   out int totalentries, //out
   int servertype, //in 3 = all
   string domain, //null primary
   int resumehandle); //must be 0

[DllImport("Netapi32")]
private static extern int NetApiBufferFree(IntPtr ptr);

[StructLayout(LayoutKind.Sequential)]
class ServerInfo 
{
   public int platformid;
   [MarshalAs(UnmanagedType.LPWStr)]
   public string name;
   public int majorver;
   public int minorver;
   public int type;
   [MarshalAs(UnmanagedType.LPWStr)]
   public string comment;
}

class MachineConvertor : TypeConverter 
{
   public override StandardValuesCollection GetStandardValues(ITypeDescriptorContext context)
   {
      int eread, etot, buffer;
      int l = 20;     
      int size = Marshal.SizeOf(typeof(ServerInfo));
      int res = NetServerEnum(
         null, 
         101, 
         out buffer, 
         size * l, 
         out eread, 
         out etot, 
         3, 
         null, 
         0);
            
      int  p = buffer;
      ArrayList arr = new ArrayList(etot);
      for (int i = 0; i < eread; i++)
      {
         ServerInfo si = Marshal.PtrToStructure((IntPtr) p, typeof(ServerInfo)) as ServerInfo;   
         arr.Add(si.name);
         p += size;
      }
      
      res = NetApiBufferFree((IntPtr) buffer);
      return new StandardValuesCollection(arr);
   }

   public override bool GetStandardValuesSupported(ITypeDescriptorContext context)
   {
      return true;
   }
}




MyDUMeter: a .NET DUMeter clone
GeneralPersonalizing Custom Controls Pin
Anonymous31-Jan-03 18:24
Anonymous31-Jan-03 18:24 
GeneralRe: Personalizing Custom Controls Pin
andyharman2-Feb-03 1:32
professionalandyharman2-Feb-03 1:32 
GeneralA question of form ;) Pin
antoine@orchus-tech31-Jan-03 17:07
antoine@orchus-tech31-Jan-03 17:07 
GeneralRe: A question of form ;) Pin
jtmtv1831-Jan-03 18:04
jtmtv1831-Jan-03 18:04 
GeneralRe: A question of form ;) Pin
antoine@orchus-tech1-Feb-03 4:36
antoine@orchus-tech1-Feb-03 4:36 
GeneralRe: A question of form ;) Pin
Stephane Rodriguez.1-Feb-03 4:45
Stephane Rodriguez.1-Feb-03 4:45 
GeneralRe: A question of form ;) Pin
Anonymous1-Feb-03 4:49
Anonymous1-Feb-03 4:49 
GeneralRe: A question of form ;) Pin
Stephane Rodriguez.1-Feb-03 5:25
Stephane Rodriguez.1-Feb-03 5:25 
QuestionToolbar buttons position? Pin
Member 14906931-Jan-03 10:24
Member 14906931-Jan-03 10:24 
AnswerRe: Toolbar buttons position? Pin
Furty31-Jan-03 18:21
Furty31-Jan-03 18:21 
GeneralC# need to create control using UserControl Pin
Vikas Aher31-Jan-03 10:16
Vikas Aher31-Jan-03 10:16 
GeneralRe: C# need to create control using UserControl Pin
Erik Funkenbusch31-Jan-03 11:47
Erik Funkenbusch31-Jan-03 11:47 
GeneralFastest Way to open Pin
jtmtv1831-Jan-03 9:49
jtmtv1831-Jan-03 9:49 
GeneralRe: Fastest Way to open Pin
Daniel Turini31-Jan-03 10:04
Daniel Turini31-Jan-03 10:04 
GeneralRe: Fastest Way to open Pin
jtmtv1831-Jan-03 10:12
jtmtv1831-Jan-03 10:12 
GeneralRe: Fastest Way to open Pin
Mark Sanders31-Jan-03 11:36
Mark Sanders31-Jan-03 11:36 
GeneralRe: Fastest Way to open Pin
jtmtv1831-Jan-03 11:56
jtmtv1831-Jan-03 11:56 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.