#C# .NET FRAMEWORK ERROR LOGIN
16 messages · Page 1 of 1 (latest)
Could you send the code?
Also, avoid pinging everyone in the future 😅
okay sry
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Appwrite;
using Appwrite.Models;
using Appwrite.Services;
using Newtonsoft.Json;
namespace WindowsFormsApp1
{
public partial class Form1 : Form
{
private Client client;
public Form1()
{
InitializeComponent();
client = new Client()
.SetEndpoint("https://cloud.appwrite.io/v1")
.SetProject("66f39506eeeewqf1be18")
.SetKey("The key");
}
private async void button1_Click_1(object sender, EventArgs e)
{
try
{
Account account = new Account(client);
Session result = await account.CreateEmailPasswordSession(
email: "[email protected]",
password: "pass"
);
// Login successful
Console.WriteLine("Session ID: " + result.Id);
}
catch (AppwriteException ex)
{
// Error occurred during login
Console.WriteLine("Login failed: " + ex.Message);
}
}
}
}
I’d remove the api key and password from this post
are you trying to use cloud or self hosted? What version of the sdk are you using?
version : 0.8.1
self hosted
i asked because I noticed your endpoint is pointing to cloud
okay
try changing that to your appwrite instance and see
@shy sun Remove your API key and create a new one, just in case. Same as the password: use a different one
same error
but when i add the full code in button void section its work but in same time give me message error say : ** the given key 'mfa' was not in present in the dictionray**