|
I want to import a spanish dictionary in my c# program
Thanks
Carlos
|
|
|
|
|
carlos read the 2 sticky messages at the top of this page and try again.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Excellent. This means that you have the beginnings of a specification for what you want your program to do. Now, you need to take this a step further and start to break this down into a more refined set of specifications. For instance, do you want to bundle the dictionary itself into your program, or do you want to use some form of RESTful API to do the lookups? Is this dictionary going to allow the user to add words? Once you have a fuller specification, and have some idea what it is that you are really trying to do, please feel free to come back at that point and ask for more information.
This space for rent
|
|
|
|
|
You have my full permission to do that. You may carry on to the next stage.
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Did he fill our form "permit 838[^]"?
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
In triplicate! Countersigned by an officer of rank 65E/44 or higher, and with the tax stamp applied.
First time I've seen that in a beginner. Hmm. I think we have a mole in the department...
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Bueno !
«While I complain of being able to see only a shadow of the past, I may be insensitive to reality as it is now, since I'm not at a stage of development where I'm capable of seeing it. A few hundred years later another traveler despairing as myself, may mourn the disappearance of what I may have seen, but failed to see.» Claude Levi-Strauss (Tristes Tropiques, 1955)
|
|
|
|
|
I need to add authentication to my Web API, so user must add token, or password to access the Web API.
Under Controller folder i have :
[AcceptVerbs("GET")]
public Reservation RPCStyleMethodFetchFirstEmployees()
{
return listEmp.FirstOrDefault();
}
[HttpGet]
[ActionName("GetReservation")]
public List<reservation> Get()
{
string source = System.Configuration.ConfigurationManager.ConnectionStrings["DefaultConnection"].ConnectionString;
SqlConnection conn = new SqlConnection(source);
SqlCommand cmd = new SqlCommand();
SqlDataReader reader;
string sql = "Select s.Id,a.Room_No ,s.Room_Description,s.Room_Capacity, b.Description, s.Location,s.Start_Date,s.Start_Time,CONVERT(VARCHAR(20),CONVERT(Varchar(50),( Concat(CONVERT(VARCHAR, s.Start_Date, 126),'T',CONVERT(VARCHAR, s.End_Time, 127)) ),105),131)+'.00Z',s.End_Time,s.Meeting_Title,s.Reservation_Reason, s.Status,s.Attendance,s.Remarks,s.Mail_To,s.Mail_CC, s.Created_User, s.Created_Password, s.Created_Access_Key from Reservation s , Rooms a, Room_Type b Where s.Room_No = a.ID And s.Room_Type = b.ID";
cmd.CommandText = sql;
cmd.CommandType = CommandType.Text;
cmd.Connection = conn;
Reservation emp = null;
conn.Open();
reader = cmd.ExecuteReader();
List<reservation> emps = new List<reservation>();
while (reader.Read())
{
emp = new Reservation();
emp.Id = Convert.ToInt32(reader.GetValue(0));
emp.Room_No = reader.GetValue(1).ToString();
emp.Room_Description = reader.GetValue(2) as string;
emp.Room_Capacity = (reader.GetValue(3) as int?) ?? 0;
emp.Room_Type = reader.GetValue(4) as string;
emp.Location = reader.GetValue(5) as string;
emp.Start_Date = reader.GetValue(6).ToString();
emp.Start_Time = reader.GetValue(7).ToString();
emp.Start_Date_Time = reader.GetValue(8).ToString();
emp.End_Time = reader.GetValue(9).ToString();
emp.Meeting_Title = reader.GetValue(10) as string;
emp.Reservation_Reason = reader.GetValue(11) as string;
emp.Status = reader.GetValue(12) as string;
emp.Attendance = (reader.GetValue(13) as int?) ?? 0;
emp.Remarks = reader.GetValue(14) as string;
emp.Mail_To = reader.GetValue(15) as string;
emp.Mail_CC = reader.GetValue(16) as string;
emp.Created_User = reader.GetValue(17) as string;
emp.Created_Password = reader.GetValue(18) as string;
emp.Created_Access_Key = reader.GetValue(19) as string;
emps.Add(emp);
}
conn.Close();
return emps;
}
and under Models i have
public class Reservation
{
public int Id { get; set; }
public string Room_No { get; set; }
public string Room_Description { get; set; }
public int Room_Capacity { get; set; }
public string Room_Type { get; set; }
public string Location { get; set; }
public string Start_Date { get; set; }
public string Start_Time { get; set; }
public string Start_Date_Time { get; set; }
public string End_Time { get; set; }
public string Meeting_Title { get; set; }
public string Reservation_Reason { get; set; }
public string Status { get; set; }
public int Attendance { get; set; }
public string Remarks { get; set; }
public string Mail_To { get; set; }
public string Mail_CC { get; set; }
public string Created_User { get; set; }
public string Created_Password { get; set; }
public string Created_Access_Key { get; set; }
}
How to add Authentication before they start get the data
Please i don't have clear information about classes and authentication, also i don't have startup.cs
please i need easy way
|
|
|
|
|
Hello, everyone
I am trying to create a program that can click button with its name of an form automatically to submit an form.
For example: There is a page that includes input-fields username and password, and two input buttons with the same tag "input" and same type "submit", but different names like "reset" and "authorize".
I am using the class IHtmlFormElement to get the HTML Form and use one of the input buttons to submit that form.
Here is my code:
IHTMLFormElement form = GetForm(0);
if (form.item("authorize", 0) != null)
{
var authorizeSubmit = form.item("authorize", 0);
}
form.submit();
My Question is, how could i tell the compiler to click the submit button with name "authorize" not "reset"? It there another way to do it better?
Thank you very much!
Carvin
|
|
|
|
|
Hello!
I want to represent a WPF-Menu based on a XML-file.
The file looks like this:
<menues>
<menu title="One">
<item title="USB-Stick" value="1234" />
</menu>
<menu title="Two">
<item title="CD" value="4321" />
</menu>
<menu title="Three">
<item title="USB-Stick" value="9876" />
<item title="Diskette" value="5667" />
<menu title="CC">
<item title="Test1" value="3234" />
<item title="Test2" value="2332" />
<item title="Test3" value="3213" />
</menu>
</menu>
</menues>
The goal is to be able to expand the menu at any time.
I hope someone can help me.
Best regards!
|
|
|
|
|
Help with what exactly? Reading XML, generating a menu, or all of it?
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Preferably all of it.
I know, how to read a XML-file, but I cant display the data as a menu.
So I don't know the connection of these things ...
|
|
|
|
|
Member 13100573 wrote: Preferably all of it. In that case you'd be asking for a developer for hire.
Member 13100573 wrote: I know, how to read a XML-file, but I cant display the data as a menu. Creating a menu dynamically isn't that hard in WinForms, so I would expect it not to be too hard in WPF either. You could search for an example and give it a try - if you get stuck and have a specific question we can help.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Deserialize the XML document to a collection of say Menu objects. Then do the necessary binding to reflect what you want in the view.
"As beings of finite lifespan, our contributions to the sum of human knowledge is one of the greatest endeavors we can undertake and one of the defining characteristics of humanity itself"
|
|
|
|
|
And what, exactly, do you want to happen when the user clicks on a menu item? If you want to know how to construct the menu itself, search for articles on MVVM menus with WPF.
This space for rent
|
|
|
|
|
You should start to read about XmlDataProvider and how to use bindings to XML-documents with XPath.
A good starting point can be How to: Bind to XML Data Using an XMLDataProvider and XPath Queries | Microsoft Docs[^]
In the example a ListBox is populated but you should be able to replace it with a Menu bound to an XmlDataProvider as ItemsSource with a customized ItemContainerStyle that sets the Header of the MenuItem to the title attribute.
Good luck.
|
|
|
|
|
i want to shutdown remote pc connected in LAn network through by using their pcname ,,how can i do in c# help me plz?
|
|
|
|
|
Read this[^], and use the Process class to execute.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
I can't seem to figure this out. Tried searching but didn't know what to call the first date format.
If it ain't broke don't fix it
|
|
|
|
|
Is it an int or a string ?
Integer:
int input = 20171005;
int year = Math.DivRem(input, 10000, out input);
int month = Math.DivRem(input, 100, out input);
DateTime dt = new DateTime(year, month, input); String:
string input = "20171005";
DateTime dt = DateTime.ParseExact(input, "yyyyMMdd", CultureInfo.InvariantCulture);
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
It's a string. I didn't think that DateParse would translate that string. hmm
I did examples of Date Parse, but I didn't know what my input format was called.
I'll give it a shot, Thanks Richard!
If it ain't broke don't fix it
|
|
|
|
|
|
string date1 = $"{DateTime.Now:MM/dd/yyyy}";
"(I) am amazed to see myself here rather than there ... now rather than then".
― Blaise Pascal
|
|
|
|
|
That looks interesting.
Actually my final output model is string for the date.
I'm gonna look into this.
If it ain't broke don't fix it
|
|
|
|
|
I have an XML file that I'm pulling data in and out of some lines are nothing more than crlf
<KEY FIELDID="451">
</KEY>
The property in the POCO class is structured like this
[XmlText]
public string Value { set; get; }
I can serialize the file and 451 comes back empty or when I save it saves as empty
<KEY FIELDID="451" />
I can update it to "\r\n" and it puts it back in the saved file.
var returned = MyType.Load("D:\\Sample.xml");
returned.AddUpdate(451,"\r\n");
MyType.Save(returned,"D:\\Output.xml");
Other Records with \r\n in them with additional data work with no problems
|
|
|
|