gloser

导航

 

在写ras拨号的时把256写错为20,这个糊涂问题居然花了我半天时间,

        const int RAS_MaxEntryName = 256;
        
const int RAS_MaxPhoneNumber = 128;
        
const int RAS_MaxCallbackNumber = 128;
        
const int UNLEN = 256;
        
const int PWLEN = 256;
        
const int DNLEN = 15;
        
        [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)]
        
public struct RASDIALPARAMS
        
{
            
public int dwSize;
            [MarshalAs(UnmanagedType.ByValTStr, SizeConst 
= RAS_MaxEntryName + 1)]
            
public string szEntryName;
            [MarshalAs(UnmanagedType.ByValTStr, SizeConst 
= RAS_MaxPhoneNumber + 1)]
            
public string szPhoneNumber;
            [MarshalAs(UnmanagedType.ByValTStr, SizeConst 
= RAS_MaxCallbackNumber + 1)]
            
public string szCallbackNumber;
            [MarshalAs(UnmanagedType.ByValTStr, SizeConst 
= UNLEN + 1)]
            
public string szUserName;
            [MarshalAs(UnmanagedType.ByValTStr, SizeConst 
= PWLEN + 1)]
            
public string szPassword;
            [MarshalAs(UnmanagedType.ByValTStr, SizeConst 
= DNLEN + 1)]
            
public string szDomain;
            
public int dwSubEntry;
            
public int dwCallbackId;
        }

posted on 2005-12-19 16:32  gloser  阅读(438)  评论(1编辑  收藏  举报