如题,
不知道是什么错,MSDN上查不到

解决方案 »

  1.   

    asp.net里面的WNetAddConnection2函数
      

  2.   

    有没有,关于WNetAddConnection2函数的返回值得一览表,有的话也非常感谢
      

  3.   

    网络共享的文件夹里放东西,因为权限问题,所以先用这个API函数连接一下,有些机器成功了,有些机器有这个返回值,不知道是什么错
      

  4.   

    函数名(function):WNetAddConnection2别名(alias):WNetAddConnection2A库名(library):mpr操作系统(os):Requires Windows NT 3.1 or later; Requires Windows 95 or later参数表(parameter):lpNetResource -- NETRESOURCE
    ?lpNetResource
    Points to a NETRESOURCE structure that specifies details of the proposed connection: information about the network resource, the local device, and the network resource provider.
    You must specify the following members of the NETRESOURCE structure:
    dwType
    Specifies the type of network resource to connect to. If lpLocalName points to a non-empty string, this member can be RESOURCETYPE_DISK or RESOURCETYPE_PRINT. If lpLocalName is NULL or points to an empty string, dwType can be RESOURCETYPE_DISK, RESOURCETYPE_PRINT, or RESOURCETYPE_ANY.
    lpLocalName
    Points to a null-terminated string that specifies the name of a local device to be redirected, such as 返回值(return):
    Long
    If the function succeeds, the return value is NO_ERROR. If the function fails, the return value is an error code. Returning an error code provides compatibility with the behavior of the Windows 3.1 function WNetAddConnection. You can also call the GetLastError function to obtain the (same) error code. One of the following error codes may be returned when WNetAddConnection2 fails:
    ERROR_ACCESS_DENIED 
    Access to the network resource was denied. ERROR_ALREADY_ASSIGNED 
    The local device specified by lpLocalName is already connected to a network resource. ERROR_BAD_DEV_TYPE 
    The type of local device and the type of network resource do not match. ERROR_BAD_DEVICE 
    The value specified by lpLocalName is invalid. ERROR_BAD_NET_NAME 
    The value specified by lpRemoteName is not acceptable to any network resource provider. The resource name is invalid, or the named resource cannot be located. ERROR_BAD_PROFILE 
    The user profile is in an incorrect format. ERROR_BAD_PROVIDER 
    The value specified by lpProvider does not match any provider. ERROR_BUSY 
    The router or provider is busy, possibly initializing. The caller should retry. ERROR_CANCELLED 
    The attempt to make the connection was cancelled by the user through a dialog box from one of the network resource providers, or by a called resource. ERROR_CANNOT_OPEN_PROFILE 
    The system is unable to open the user profile to process persistent connections. ERROR_DEVICE_ALREADY_REMEMBERED 
    An entry for the device specified in lpLocalName is already in the user profile. ERROR_EXTENDED_ERROR 
    A network-specific error occured. Call the WNetGetLastError function to get a description of the error. ERROR_INVALID_PASSWORD 
    The specified password is invalid. ERROR_NO_NET_OR_BAD_PATH 
    A network component has not started, or the specified name could not be handled. ERROR_NO_NETWORK 
    There is no network present. 
    说明(description):The WNetAddConnection2 function makes a connection to a network resource. The function can redirect a local device to the network resource.
    声明(declare):Declare Function WNetAddConnection2 Lib "mpr.dll" Alias "WNetAddConnection2A" (lpNetResource As NETRESOURCE, ByVal lpPassword As String, ByVal lpUserName As String, ByVal dwFlags As Long) As Long 例程(example):Enum Resources
    AddConnection2
    .net对应函数(dotnet):
    .net例程(dotnet example):
      

  5.   

    这些东西偶不懂,希望楼主介绍介绍该学哪方面的东西,什么API之类的,我都没有深入学习过,只知道是windows底层的东西,可以调用,很重要.但是.net缺少这些支持吗?
    不大懂.
    网络这一块也是皮毛.
    你是做的winform编程吧
      

  6.   

    ‘大宋’
    您发的东东,貌似没有看懂,
    在WebService层那里发出的错,原先是网络共享文件夹里保存文件发生权限问题了,用了API函数后解决问题了,但是有些机器突然冒出了1327这个问题,我就头晕了,
    网上查不到
      

  7.   

    TO‘倦怠’
    GetLastError是函数?
     
      

  8.   

    好东西,加上APIviewer,就很好啦 !