tutorials.de Buch-Aktion 05/2012
Like Tree2Danke
  • 1 Beitrag von MCoder
  • 1 Beitrag von MCoder
ERLEDIGT
JA
ANTWORTEN
12
ZUGRIFFE
318
EMPFEHLEN
  • An Twitter übertragen
  • An Facebook übertragen
AUF DIESES THEMA
ANTWORTEN
  1. #1
    Nawi0 Nawi0 ist offline Mitglied Silber
    Registriert seit
    Oct 2009
    Beiträge
    71
    Hey ich weis nich ob die frage schon mal gestellt wurde...
    aber gibt es ne einsteigerfreundliche art ein File von oder auf einen server zu laden?
    hab mir einige sachen angeschaut bin aber erlichgesagt nich ganz dahintergestiegen....

    wäre seeeeehr dankbar für ein EINFACHES Beispiel mit schritt für schritt anleitung
     

  2. #2
    chibisuke chibisuke ist offline Mitglied Brillant
    Registriert seit
    Sep 2003
    Beiträge
    807
    Da gibts ne ganze reihe möglichkeiten, die vor allem stark davon abhängen was du für protokolle verwenden willst.(FTP, HTTP, WebDAV, Cifs, NFS, ....)

    Am einfachsten dürften down und upload mittels HTTP oder FTP unter windows zu realisieren sein indem man WinINET verwendet.
    http://msdn.microsoft.com/en-us/libr...=vs.85%29.aspx
    (InternetOpen, InternetConnect, FtpGet, FtpPut ect.)

    Wenn du eher was cross platform kompatibles haben willst, gibt es libcurl (http://curl.haxx.se/)

    oder du kannst natürlich auch direkt mit sockets arbeiten um das ergebniss zu erreichen.
     

  3. #3
    Nawi0 Nawi0 ist offline Mitglied Silber
    Registriert seit
    Oct 2009
    Beiträge
    71
    Okay hab mir mal das mit Ftpput / get angeschaut nun aber volgendes problem sobald ich
    Code :
    1
    2
    3
    4
    5
    6
    
    #include <windows.h>
    #include <strsafe.h>
    #include <wininet.h>
     
    #pragma comment(lib, "wininet.lib")
    #pragma comment(lib, "user32.lib")

    das includiere kommt mir mein compiler mit:

    Code :
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    
    C:\Program Files (x86)\Microsoft Visual Studio 8\VC\PlatformSDK\include\strsafe.h(431) : error C3641: 'StringCchCopyA' : invalid calling convention '__stdcall ' for function compiled with /clr:pure or /clr:safe
    C:\Program Files (x86)\Microsoft Visual Studio 8\VC\PlatformSDK\include\strsafe.h(437) : error C3641: 'StringCchCopyW' : invalid calling convention '__stdcall ' for function compiled with /clr:pure or /clr:safe
    C:\Program Files (x86)\Microsoft Visual Studio 8\VC\PlatformSDK\include\strsafe.h(560) : error C3641: 'StringCbCopyA' : invalid calling convention '__stdcall ' for function compiled with /clr:pure or /clr:safe
    C:\Program Files (x86)\Microsoft Visual Studio 8\VC\PlatformSDK\include\strsafe.h(566) : error C3641: 'StringCbCopyW' : invalid calling convention '__stdcall ' for function compiled with /clr:pure or /clr:safe
    C:\Program Files (x86)\Microsoft Visual Studio 8\VC\PlatformSDK\include\strsafe.h(723) : error C3641: 'StringCchCopyExA' : invalid calling convention '__stdcall ' for function compiled with /clr:pure or /clr:safe
    C:\Program Files (x86)\Microsoft Visual Studio 8\VC\PlatformSDK\include\strsafe.h(732) : error C3641: 'StringCchCopyExW' : invalid calling convention '__stdcall ' for function compiled with /clr:pure or /clr:safe
    C:\Program Files (x86)\Microsoft Visual Studio 8\VC\PlatformSDK\include\strsafe.h(900) : error C3641: 'StringCbCopyExA' : invalid calling convention '__stdcall ' for function compiled with /clr:pure or /clr:safe
    C:\Program Files (x86)\Microsoft Visual Studio 8\VC\PlatformSDK\include\strsafe.h(909) : error C3641: 'StringCbCopyExW' : invalid calling convention '__stdcall ' for function compiled with /clr:pure or /clr:safe
    C:\Program Files (x86)\Microsoft Visual Studio 8\VC\PlatformSDK\include\strsafe.h(1070) : error C3641: 'StringCchCopyNA' : invalid calling convention '__stdcall ' for function compiled with /clr:pure or /clr:safe
    C:\Program Files (x86)\Microsoft Visual Studio 8\VC\PlatformSDK\include\strsafe.h(1077) : error C3641: 'StringCchCopyNW' : invalid calling convention '__stdcall ' for function compiled with /clr:pure or /clr:safe
    C:\Program Files (x86)\Microsoft Visual Studio 8\VC\PlatformSDK\include\strsafe.h(1207) : error C3641: 'StringCbCopyNA' : invalid calling convention '__stdcall ' for function compiled with /clr:pure or /clr:safe
    C:\Program Files (x86)\Microsoft Visual Studio 8\VC\PlatformSDK\include\strsafe.h(1214) : error C3641: 'StringCbCopyNW' : invalid calling convention '__stdcall ' for function compiled with /clr:pure or /clr:safe
    C:\Program Files (x86)\Microsoft Visual Studio 8\VC\PlatformSDK\include\strsafe.h(1389) : error C3641: 'StringCchCopyNExA' : invalid calling convention '__stdcall ' for function compiled with /clr:pure or /clr:safe
    C:\Program Files (x86)\Microsoft Visual Studio 8\VC\PlatformSDK\include\strsafe.h(1399) : error C3641: 'StringCchCopyNExW' : invalid calling convention '__stdcall ' for function compiled with /clr:pure or /clr:safe
    C:\Program Files (x86)\Microsoft Visual Studio 8\VC\PlatformSDK\include\strsafe.h(1577) : error C3641: 'StringCbCopyNExA' : invalid calling convention '__stdcall ' for function compiled with /clr:pure or /clr:safe
    C:\Program Files (x86)\Microsoft Visual Studio 8\VC\PlatformSDK\include\strsafe.h(1587) : error C3641: 'StringCbCopyNExW' : invalid calling convention '__stdcall ' for function compiled with /clr:pure or /clr:safe
    C:\Program Files (x86)\Microsoft Visual Studio 8\VC\PlatformSDK\include\strsafe.h(1747) : error C3641: 'StringCchCatA' : invalid calling convention '__stdcall ' for function compiled with /clr:pure or /clr:safe
    C:\Program Files (x86)\Microsoft Visual Studio 8\VC\PlatformSDK\include\strsafe.h(1753) : error C3641: 'StringCchCatW' : invalid calling convention '__stdcall ' for function compiled with /clr:pure or /clr:safe
    C:\Program Files (x86)\Microsoft Visual Studio 8\VC\PlatformSDK\include\strsafe.h(1869) : error C3641: 'StringCbCatA' : invalid calling convention '__stdcall ' for function compiled with /clr:pure or /clr:safe
    C:\Program Files (x86)\Microsoft Visual Studio 8\VC\PlatformSDK\include\strsafe.h(1875) : error C3641: 'StringCbCatW' : invalid calling convention '__stdcall ' for function compiled with /clr:pure or /clr:safe
    C:\Program Files (x86)\Microsoft Visual Studio 8\VC\PlatformSDK\include\strsafe.h(2035) : error C3641: 'StringCchCatExA' : invalid calling convention '__stdcall ' for function compiled with /clr:pure or /clr:safe
    C:\Program Files (x86)\Microsoft Visual Studio 8\VC\PlatformSDK\include\strsafe.h(2044) : error C3641: 'StringCchCatExW' : invalid calling convention '__stdcall ' for function compiled with /clr:pure or /clr:safe
    C:\Program Files (x86)\Microsoft Visual Studio 8\VC\PlatformSDK\include\strsafe.h(2215) : error C3641: 'StringCbCatExA' : invalid calling convention '__stdcall ' for function compiled with /clr:pure or /clr:safe
    C:\Program Files (x86)\Microsoft Visual Studio 8\VC\PlatformSDK\include\strsafe.h(2224) : error C3641: 'StringCbCatExW' : invalid calling convention '__stdcall ' for function compiled with /clr:pure or /clr:safe
    C:\Program Files (x86)\Microsoft Visual Studio 8\VC\PlatformSDK\include\strsafe.h(2383) : error C3641: 'StringCchCatNA' : invalid calling convention '__stdcall ' for function compiled with /clr:pure or /clr:safe
    C:\Program Files (x86)\Microsoft Visual Studio 8\VC\PlatformSDK\include\strsafe.h(2390) : error C3641: 'StringCchCatNW' : invalid calling convention '__stdcall ' for function compiled with /clr:pure or /clr:safe
    C:\Program Files (x86)\Microsoft Visual Studio 8\VC\PlatformSDK\include\strsafe.h(2515) : error C3641: 'StringCbCatNA' : invalid calling convention '__stdcall ' for function compiled with /clr:pure or /clr:safe
    C:\Program Files (x86)\Microsoft Visual Studio 8\VC\PlatformSDK\include\strsafe.h(2522) : error C3641: 'StringCbCatNW' : invalid calling convention '__stdcall ' for function compiled with /clr:pure or /clr:safe
    C:\Program Files (x86)\Microsoft Visual Studio 8\VC\PlatformSDK\include\strsafe.h(2692) : error C3641: 'StringCchCatNExA' : invalid calling convention '__stdcall ' for function compiled with /clr:pure or /clr:safe
    C:\Program Files (x86)\Microsoft Visual Studio 8\VC\PlatformSDK\include\strsafe.h(2702) : error C3641: 'StringCchCatNExW' : invalid calling convention '__stdcall ' for function compiled with /clr:pure or /clr:safe
    C:\Program Files (x86)\Microsoft Visual Studio 8\VC\PlatformSDK\include\strsafe.h(2879) : error C3641: 'StringCbCatNExA' : invalid calling convention '__stdcall ' for function compiled with /clr:pure or /clr:safe
    C:\Program Files (x86)\Microsoft Visual Studio 8\VC\PlatformSDK\include\strsafe.h(2889) : error C3641: 'StringCbCatNExW' : invalid calling convention '__stdcall ' for function compiled with /clr:pure or /clr:safe
    C:\Program Files (x86)\Microsoft Visual Studio 8\VC\PlatformSDK\include\strsafe.h(3053) : error C3641: 'StringCchVPrintfA' : invalid calling convention '__stdcall ' for function compiled with /clr:pure or /clr:safe
    C:\Program Files (x86)\Microsoft Visual Studio 8\VC\PlatformSDK\include\strsafe.h(3053) : error C4439: 'StringCchVPrintfA' : function definition with a managed type in the signature must have a __clrcall calling convention
    C:\Program Files (x86)\Microsoft Visual Studio 8\VC\PlatformSDK\include\strsafe.h(3060) : error C3641: 'StringCchVPrintfW' : invalid calling convention '__stdcall ' for function compiled with /clr:pure or /clr:safe
    C:\Program Files (x86)\Microsoft Visual Studio 8\VC\PlatformSDK\include\strsafe.h(3060) : error C4439: 'StringCchVPrintfW' : function definition with a managed type in the signature must have a __clrcall calling convention
    C:\Program Files (x86)\Microsoft Visual Studio 8\VC\PlatformSDK\include\strsafe.h(3184) : error C3641: 'StringCbVPrintfA' : invalid calling convention '__stdcall ' for function compiled with /clr:pure or /clr:safe
    C:\Program Files (x86)\Microsoft Visual Studio 8\VC\PlatformSDK\include\strsafe.h(3184) : error C4439: 'StringCbVPrintfA' : function definition with a managed type in the signature must have a __clrcall calling convention
    C:\Program Files (x86)\Microsoft Visual Studio 8\VC\PlatformSDK\include\strsafe.h(3191) : error C3641: 'StringCbVPrintfW' : invalid calling convention '__stdcall ' for function compiled with /clr:pure or /clr:safe
    C:\Program Files (x86)\Microsoft Visual Studio 8\VC\PlatformSDK\include\strsafe.h(3191) : error C4439: 'StringCbVPrintfW' : function definition with a managed type in the signature must have a __clrcall calling convention
    C:\Program Files (x86)\Microsoft Visual Studio 8\VC\PlatformSDK\include\strsafe.h(4066) : error C3641: 'StringCchVPrintfExA' : invalid calling convention '__stdcall ' for function compiled with /clr:pure or /clr:safe
    C:\Program Files (x86)\Microsoft Visual Studio 8\VC\PlatformSDK\include\strsafe.h(4066) : error C4439: 'StringCchVPrintfExA' : function definition with a managed type in the signature must have a __clrcall calling convention
    C:\Program Files (x86)\Microsoft Visual Studio 8\VC\PlatformSDK\include\strsafe.h(4076) : error C3641: 'StringCchVPrintfExW' : invalid calling convention '__stdcall ' for function compiled with /clr:pure or /clr:safe
    C:\Program Files (x86)\Microsoft Visual Studio 8\VC\PlatformSDK\include\strsafe.h(4076) : error C4439: 'StringCchVPrintfExW' : function definition with a managed type in the signature must have a __clrcall calling convention
    C:\Program Files (x86)\Microsoft Visual Studio 8\VC\PlatformSDK\include\strsafe.h(4251) : error C3641: 'StringCbVPrintfExA' : invalid calling convention '__stdcall ' for function compiled with /clr:pure or /clr:safe
    C:\Program Files (x86)\Microsoft Visual Studio 8\VC\PlatformSDK\include\strsafe.h(4251) : error C4439: 'StringCbVPrintfExA' : function definition with a managed type in the signature must have a __clrcall calling convention
    C:\Program Files (x86)\Microsoft Visual Studio 8\VC\PlatformSDK\include\strsafe.h(4261) : error C3641: 'StringCbVPrintfExW' : invalid calling convention '__stdcall ' for function compiled with /clr:pure or /clr:safe
    C:\Program Files (x86)\Microsoft Visual Studio 8\VC\PlatformSDK\include\strsafe.h(4261) : error C4439: 'StringCbVPrintfExW' : function definition with a managed type in the signature must have a __clrcall calling convention
    C:\Program Files (x86)\Microsoft Visual Studio 8\VC\PlatformSDK\include\strsafe.h(4417) : error C3641: 'StringCchGetsA' : invalid calling convention '__stdcall ' for function compiled with /clr:pure or /clr:safe
    C:\Program Files (x86)\Microsoft Visual Studio 8\VC\PlatformSDK\include\strsafe.h(4422) : error C3641: 'StringCchGetsW' : invalid calling convention '__stdcall ' for function compiled with /clr:pure or /clr:safe
    C:\Program Files (x86)\Microsoft Visual Studio 8\VC\PlatformSDK\include\strsafe.h(4543) : error C3641: 'StringCbGetsA' : invalid calling convention '__stdcall ' for function compiled with /clr:pure or /clr:safe
    C:\Program Files (x86)\Microsoft Visual Studio 8\VC\PlatformSDK\include\strsafe.h(4548) : error C3641: 'StringCbGetsW' : invalid calling convention '__stdcall ' for function compiled with /clr:pure or /clr:safe
    C:\Program Files (x86)\Microsoft Visual Studio 8\VC\PlatformSDK\include\strsafe.h(4694) : error C3641: 'StringCchGetsExA' : invalid calling convention '__stdcall ' for function compiled with /clr:pure or /clr:safe
    C:\Program Files (x86)\Microsoft Visual Studio 8\VC\PlatformSDK\include\strsafe.h(4702) : error C3641: 'StringCchGetsExW' : invalid calling convention '__stdcall ' for function compiled with /clr:pure or /clr:safe
    C:\Program Files (x86)\Microsoft Visual Studio 8\VC\PlatformSDK\include\strsafe.h(4859) : error C3641: 'StringCbGetsExA' : invalid calling convention '__stdcall ' for function compiled with /clr:pure or /clr:safe
    C:\Program Files (x86)\Microsoft Visual Studio 8\VC\PlatformSDK\include\strsafe.h(4867) : error C3641: 'StringCbGetsExW' : invalid calling convention '__stdcall ' for function compiled with /clr:pure or /clr:safe
    C:\Program Files (x86)\Microsoft Visual Studio 8\VC\PlatformSDK\include\strsafe.h(5008) : error C3641: 'StringCchLengthA' : invalid calling convention '__stdcall ' for function compiled with /clr:pure or /clr:safe
    C:\Program Files (x86)\Microsoft Visual Studio 8\VC\PlatformSDK\include\strsafe.h(5014) : error C3641: 'StringCchLengthW' : invalid calling convention '__stdcall ' for function compiled with /clr:pure or /clr:safe
    C:\Program Files (x86)\Microsoft Visual Studio 8\VC\PlatformSDK\include\strsafe.h(5129) : error C3641: 'StringCbLengthA' : invalid calling convention '__stdcall ' for function compiled with /clr:pure or /clr:safe
    C:\Program Files (x86)\Microsoft Visual Studio 8\VC\PlatformSDK\include\strsafe.h(5135) : error C3641: 'StringCbLengthW' : invalid calling convention '__stdcall ' for function compiled with /clr:pure or /clr:safe
    C:\Program Files (x86)\Microsoft Visual Studio 8\VC\PlatformSDK\include\strsafe.h(152) : error C3641: 'StringCopyWorkerA' : invalid calling convention '__stdcall ' for function compiled with /clr:pure or /clr:safe
    C:\Program Files (x86)\Microsoft Visual Studio 8\VC\PlatformSDK\include\strsafe.h(158) : error C3641: 'StringCopyWorkerW' : invalid calling convention '__stdcall ' for function compiled with /clr:pure or /clr:safe
    C:\Program Files (x86)\Microsoft Visual Studio 8\VC\PlatformSDK\include\strsafe.h(164) : error C3641: 'StringCopyExWorkerA' : invalid calling convention '__stdcall ' for function compiled with /clr:pure or /clr:safe
    C:\Program Files (x86)\Microsoft Visual Studio 8\VC\PlatformSDK\include\strsafe.h(174) : error C3641: 'StringCopyExWorkerW' : invalid calling convention '__stdcall ' for function compiled with /clr:pure or /clr:safe
    C:\Program Files (x86)\Microsoft Visual Studio 8\VC\PlatformSDK\include\strsafe.h(184) : error C3641: 'StringCopyNWorkerA' : invalid calling convention '__stdcall ' for function compiled with /clr:pure or /clr:safe
    C:\Program Files (x86)\Microsoft Visual Studio 8\VC\PlatformSDK\include\strsafe.h(191) : error C3641: 'StringCopyNWorkerW' : invalid calling convention '__stdcall ' for function compiled with /clr:pure or /clr:safe
    C:\Program Files (x86)\Microsoft Visual Studio 8\VC\PlatformSDK\include\strsafe.h(198) : error C3641: 'StringCopyNExWorkerA' : invalid calling convention '__stdcall ' for function compiled with /clr:pure or /clr:safe
    C:\Program Files (x86)\Microsoft Visual Studio 8\VC\PlatformSDK\include\strsafe.h(209) : error C3641: 'StringCopyNExWorkerW' : invalid calling convention '__stdcall ' for function compiled with /clr:pure or /clr:safe
    C:\Program Files (x86)\Microsoft Visual Studio 8\VC\PlatformSDK\include\strsafe.h(220) : error C3641: 'StringCatWorkerA' : invalid calling convention '__stdcall ' for function compiled with /clr:pure or /clr:safe
    C:\Program Files (x86)\Microsoft Visual Studio 8\VC\PlatformSDK\include\strsafe.h(226) : error C3641: 'StringCatWorkerW' : invalid calling convention '__stdcall ' for function compiled with /clr:pure or /clr:safe
    C:\Program Files (x86)\Microsoft Visual Studio 8\VC\PlatformSDK\include\strsafe.h(232) : error C3641: 'StringCatExWorkerA' : invalid calling convention '__stdcall ' for function compiled with /clr:pure or /clr:safe
    C:\Program Files (x86)\Microsoft Visual Studio 8\VC\PlatformSDK\include\strsafe.h(242) : error C3641: 'StringCatExWorkerW' : invalid calling convention '__stdcall ' for function compiled with /clr:pure or /clr:safe
    C:\Program Files (x86)\Microsoft Visual Studio 8\VC\PlatformSDK\include\strsafe.h(252) : error C3641: 'StringCatNWorkerA' : invalid calling convention '__stdcall ' for function compiled with /clr:pure or /clr:safe
    C:\Program Files (x86)\Microsoft Visual Studio 8\VC\PlatformSDK\include\strsafe.h(259) : error C3641: 'StringCatNWorkerW' : invalid calling convention '__stdcall ' for function compiled with /clr:pure or /clr:safe
    C:\Program Files (x86)\Microsoft Visual Studio 8\VC\PlatformSDK\include\strsafe.h(266) : error C3641: 'StringCatNExWorkerA' : invalid calling convention '__stdcall ' for function compiled with /clr:pure or /clr:safe
    C:\Program Files (x86)\Microsoft Visual Studio 8\VC\PlatformSDK\include\strsafe.h(277) : error C3641: 'StringCatNExWorkerW' : invalid calling convention '__stdcall ' for function compiled with /clr:pure or /clr:safe
    C:\Program Files (x86)\Microsoft Visual Studio 8\VC\PlatformSDK\include\strsafe.h(288) : error C3641: 'StringVPrintfWorkerA' : invalid calling convention '__stdcall ' for function compiled with /clr:pure or /clr:safe
    C:\Program Files (x86)\Microsoft Visual Studio 8\VC\PlatformSDK\include\strsafe.h(288) : error C4439: 'StringVPrintfWorkerA' : function definition with a managed type in the signature must have a __clrcall calling convention
    C:\Program Files (x86)\Microsoft Visual Studio 8\VC\PlatformSDK\include\strsafe.h(295) : error C3641: 'StringVPrintfWorkerW' : invalid calling convention '__stdcall ' for function compiled with /clr:pure or /clr:safe
    C:\Program Files (x86)\Microsoft Visual Studio 8\VC\PlatformSDK\include\strsafe.h(295) : error C4439: 'StringVPrintfWorkerW' : function definition with a managed type in the signature must have a __clrcall calling convention
    C:\Program Files (x86)\Microsoft Visual Studio 8\VC\PlatformSDK\include\strsafe.h(302) : error C3641: 'StringVPrintfExWorkerA' : invalid calling convention '__stdcall ' for function compiled with /clr:pure or /clr:safe
    C:\Program Files (x86)\Microsoft Visual Studio 8\VC\PlatformSDK\include\strsafe.h(302) : error C4439: 'StringVPrintfExWorkerA' : function definition with a managed type in the signature must have a __clrcall calling convention
    C:\Program Files (x86)\Microsoft Visual Studio 8\VC\PlatformSDK\include\strsafe.h(313) : error C3641: 'StringVPrintfExWorkerW' : invalid calling convention '__stdcall ' for function compiled with /clr:pure or /clr:safe
    C:\Program Files (x86)\Microsoft Visual Studio 8\VC\PlatformSDK\include\strsafe.h(313) : error C4439: 'StringVPrintfExWorkerW' : function definition with a managed type in the signature must have a __clrcall calling convention
    C:\Program Files (x86)\Microsoft Visual Studio 8\VC\PlatformSDK\include\strsafe.h(324) : error C3641: 'StringLengthWorkerA' : invalid calling convention '__stdcall ' for function compiled with /clr:pure or /clr:safe
    C:\Program Files (x86)\Microsoft Visual Studio 8\VC\PlatformSDK\include\strsafe.h(330) : error C3641: 'StringLengthWorkerW' : invalid calling convention '__stdcall ' for function compiled with /clr:pure or /clr:safe
    C:\Program Files (x86)\Microsoft Visual Studio 8\VC\PlatformSDK\include\strsafe.h(341) : error C3641: 'StringGetsExWorkerA' : invalid calling convention '__stdcall ' for function compiled with /clr:pure or /clr:safe
    C:\Program Files (x86)\Microsoft Visual Studio 8\VC\PlatformSDK\include\strsafe.h(350) : error C3641: 'StringGetsExWorkerW' : invalid calling convention '__stdcall ' for function compiled with /clr:pure or /clr:safe

    zum projekt kann ich sagen das es eine neue windows forms anwendung is wo bi jetzt 1 button ohne funktioon drauf is woran liegt das?-..-

    und dann hätte ich noch eine frage :

    Wie kann man während der laufzeit neue Buttons erstellen mit

    "definiertername+int" als name?

    so hab ichs versucht

    Code :
    1
    2
    
    butt+i.ToString Button=gcnew Button();
    butt();

    Code :
    1
    2
    3
    
                     Button().Name="Test";
                     Button().Visible=1;
                     Button().Location=Point(0,0);
    Geändert von Nawi0 (19.07.11 um 14:36 Uhr)
     

  4. #4
    MCoder MCoder ist offline Mitglied Diamant
    tutorials.de Premium-User
    Registriert seit
    Jul 2005
    Ort
    München
    Beiträge
    2.448
    Hallo,

    wenn du eine Windows-Forms-Anwendung hast, dann benutze die Klasse WebClient aus der .NET-Bibliothek.

    Gruß
    MCoder
    Nawi0 bedankt sich. 
    "The three chief virtues of a programmer are: Laziness, Impatience and Hubris."
    --- Larry Wall

  5. #5
    Steiner_B Steiner_B ist offline Mitglied Platin
    Registriert seit
    Mar 2004
    Ort
    Wien
    Beiträge
    573
    Hallo,

    Erstmal vorweg: Wenn du mit Windows Forms arbeitest bist du mit C++/CLI aus der .NET Umgebung unterwegs und nicht mit C++.

    Genau daraus resultieren auch die Fehlermeldungen. Wenn du mit .NET arbeitest solltest du dir anschauen welche Möglichkeiten dir dieses von sich aus schon bietet um mit Netzwerken zu arbeiten.

    Zur Frage mit den Buttons: Nein, du kannst keine String-Operationen verwenden um einen Variablennamen zu deklarieren. Was du aber machen kannst, ist die Buttons in einem Array abzuspeichern. Dann kannst du mit
    Code csharp:
    1
    2
    
    Button[] butt = gcnew Button[10];
    butt[i] = gcnew Button();
    darauf zugreifen.

    Zu deinem geposteten Code: Der ist sowieso Kraut und Rüben, 1. Zeile: Wenn du eine Variable deklarierst kommt IMMER: int i; und nicht i int;
    Dann stellt sich mir die Frage warum du überall Button() verwendest wenn deine Variable butt heißt. Mit Button() rufst du den Konstruktor der Klasse Button auf. Und wenn mich nicht alles täuscht fehlt in der Zeile mit der Location ein gcnew.
     

  6. #6
    Nawi0 Nawi0 ist offline Mitglied Silber
    Registriert seit
    Oct 2009
    Beiträge
    71
    Hallo,

    Erstmal vorweg: Wenn du mit Windows Forms arbeitest bist du mit C++/CLI aus der .NET Umgebung unterwegs und nicht mit C++.

    Genau daraus resultieren auch die Fehlermeldungen. Wenn du mit .NET arbeitest solltest du dir anschauen welche Möglichkeiten dir dieses von sich aus schon bietet um mit Netzwerken zu arbeiten.
    Okay das wuste ich nicht danke...
    Zitat Zitat von Steiner_B Beitrag anzeigen
    Zu deinem geposteten Code: Der ist sowieso Kraut und Rüben, 1. Zeile: Wenn du eine Variable deklarierst kommt IMMER: int i; und nicht i int;
    Dann stellt sich mir die Frage warum du überall Button() verwendest wenn deine Variable butt heißt. Mit Button() rufst du den Konstruktor der Klasse Button auf. Und wenn mich nicht alles täuscht fehlt in der Zeile mit der Location ein gcnew.
    das sind zwie unabhängige schnipsel also 2 versuche .

    Wenn du eine Variable deklarierst kommt IMMER: int i; und nicht i int;
    Okay das war mein fehler aber im großen und ganzen hätte es so sein sollen
    Code :
    1
    2
    
    int i;
    butt+i.ToString ..... etc

    und wie meinst du es mitt die buttons in einem array ablegen ich will ja komplett neue während der laufzeit draufpacken....

    in c binn ich noch nich so bewandert sry ..
     

  7. #7
    Steiner_B Steiner_B ist offline Mitglied Platin
    Registriert seit
    Mar 2004
    Ort
    Wien
    Beiträge
    573
    Wenn du die Anzahl vorher nicht kennst kannst du eine .NET ArrayList oder einen vector verwenden. Du kannst auf jeden Fall keine Variablennamen aus Strings kombinieren.
     

  8. #8
    Avatar von sheel
    sheel sheel ist offline Moderator
    tutorials.de Moderator
    Registriert seit
    Jul 2007
    Beiträge
    4.501
    Hi

    nur um ein häufiges Missverständnis zu beseitigen:

    Zitat Zitat von Nawi0 Beitrag anzeigen
    in c binn ich noch nich so bewandert sry ..
    Das ist kein C.
    Hat Steiner_B ja auch schon geschrieben.

    Gruß
     

  9. #9
    Nawi0 Nawi0 ist offline Mitglied Silber
    Registriert seit
    Oct 2009
    Beiträge
    71
    Zitat Zitat von sheel Beitrag anzeigen
    Hi

    nur um ein häufiges Missverständnis zu beseitigen:



    Das ist kein C.
    Hat Steiner_B ja auch schon geschrieben.

    Gruß
    c++ is aber der nachvolger von c# oder sehe ich das falsch damit wollte ich eigentlich sagen das ich beide sprachen erst anfange-.-
     

  10. #10
    MCoder MCoder ist offline Mitglied Diamant
    tutorials.de Premium-User
    Registriert seit
    Jul 2005
    Ort
    München
    Beiträge
    2.448
    Zitat Zitat von Nawi0 Beitrag anzeigen
    c++ is aber der nachvolger von c# oder sehe ich das falsch damit wollte ich eigentlich sagen das ich beide sprachen erst anfange-.-
    C++ ist die Erweiterung von C um objektorientierte Sprachelemente. C# ist eine vollkommen neue Sprache, die sicher von vorhandenen Sprachen teilweise inspiriert ist, aber ansonsten keine Beziehung etwa zu C/C++ hat.

    Für die Arbeit mit dem .NET-Framwork (deine Windows-Forms-Anwendung) hat Microsoft das sogenannte Managed C++ erfunden - eine Sprache, die es sonst nirgendwo gibt und daher ziemlich proprietär ist.
    das "Managed" bezieht sich auf die Tatsache, dass .NET ein Speichermanagment mitbringt. Man muss sich nicht mehr um das Aufräumen von alloziierten Speicher kümmern. Das erledigt ein sogenannter Garbage Collector. Allerdings wird nun das Zusammenwirken mit herkömmlichen (unmanaged) C++ Code komplizierter, wie du ja schon bei deinen ersten Versuchen mit der Windows-API gemerkt hast.

    Gruß
    MCoder
     
    "The three chief virtues of a programmer are: Laziness, Impatience and Hubris."
    --- Larry Wall

  11. #11
    Nawi0 Nawi0 ist offline Mitglied Silber
    Registriert seit
    Oct 2009
    Beiträge
    71
    OOkay ich merk grad das ich wirklich nich all zu viel weis -.-'

    Aber meine frage bleibt t.dem ...
    wie kann ich den nu n neuen button erstellen oder geht das gar nich?
     

  12. #12
    MCoder MCoder ist offline Mitglied Diamant
    tutorials.de Premium-User
    Registriert seit
    Jul 2005
    Ort
    München
    Beiträge
    2.448
    Dann solltest dich mal mit den Grundlagen beschäftigen.
    Wie man einen Button erzeugt, kann ich dir zeigen:
    Code cpp:
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    
    Form1(void)
    {
        //...
     
        Button^ myButton   = gcnew Button();
        myButton->Text     = "Klick mich";
        myButton->Location = System::Drawing::Point(10,100);
        myButton->Size     = System::Drawing::Size(75,25);
     
        myButton->Click +=  gcnew System::EventHandler(this, &Form1::OnClickMyButton);
     
        Controls->Add(myButton); // Zur Form hinzufügen
        
        // ...
    }
     
    // ...
     
    void OnClickMyButton(System::Object^  sender, System::EventArgs^  e)
    {
        // ...
    }
    Gruß
    MCoder
    Nawi0 bedankt sich. 
    "The three chief virtues of a programmer are: Laziness, Impatience and Hubris."
    --- Larry Wall

  13. #13
    Nawi0 Nawi0 ist offline Mitglied Silber
    Registriert seit
    Oct 2009
    Beiträge
    71
    Very Nice Danke dir mal was das funktioniert DDD
     

Ähnliche Themen

  1. Frage zu Files-Upload
    Von starfoxfs im Forum PHP
    Antworten: 8
    Letzter Beitrag: 12.02.10, 11:16
  2. Frage zu Upload + Tutorial
    Von Ich_halt224 im Forum PHP
    Antworten: 22
    Letzter Beitrag: 19.07.08, 09:10
  3. Frage zum upload tutorial
    Von matze1983 im Forum PHP
    Antworten: 7
    Letzter Beitrag: 30.10.07, 09:54
  4. Upload frage
    Von Malaxo im Forum PHP
    Antworten: 3
    Letzter Beitrag: 30.01.07, 08:36
  5. upload-frage
    Von dji im Forum PHP
    Antworten: 4
    Letzter Beitrag: 02.12.02, 09:38