
本文介绍了无法从“方法组”转换为“字符串” – c#程序员分享,有助于帮助完成毕业设计以及求职,是一篇很好的资料。
对技术面试,学习经验等有一些体会,在此分享。
抱歉打扰大家。我正在编程一个网站,并且在将密码存储在数据库中之前尝试对密码进行哈希处理,但出现错误。我已经看到了相关的建议,建议人们使用“ .ToString()”,但是当我尝试这样做时,似乎会产生更多的错误。任何帮助将不胜感激。
try { //hashing attempt string hashresult = Convert.ToInt32(FormsAuthentication.HashPasswordForStoringInConfigFile(TextBox4.Text.Trim, "SHA1")); //the error is on this line (TextBox4.Text.Trim) //.ToString() //end SqlConnection con = new SqlConnection(strcon); if (con.State == System.Data.ConnectionState.Closed) { //if its closed the program will open it con.Open(); } //texbox info to SQL SqlCommand cmd = new SqlCommand("insert into user_master_tbl(name,email,dob,region,postcode,user_id,password) values(@name,@email,@dob,@region,@postcode,@user_id,@password)", con); //connecting textbox to the information typed in cmd.Parameters.AddWithValue("@name", TextBox3.Text.Trim()); cmd.Parameters.AddWithValue("@email", TextBox1.Text.Trim()); cmd.Parameters.AddWithValue("@dob", TextBox2.Text.Trim()); cmd.Parameters.AddWithValue("@region", DropDownList1.SelectedItem.Value); cmd.Parameters.AddWithValue("@postcode", TextBox6.Text.Trim()); cmd.Parameters.AddWithValue("@user_id", TextBox9.Text.Trim()); cmd.Parameters.AddWithValue("@password", hashresult); //firing connection to database cmd.ExecuteNonQuery(); con.Close(); Response.Write("<script>" + "alert('Account created successfully, please proceed to login to your account');" + "</script>"); }```
参考方案
TextBox4.Text.Trim
…应该:
TextBox4.Text.Trim()
整个行应如下所示:
string hashresult = FormsAuthentication.HashPasswordForStoringInConfigFile(TextBox4.Text.Trim(), "SHA1");
当回复有时是一个对象有时是一个数组时,如何在使用改造时解析JSON回复? – java
我正在使用Retrofit来获取JSON答复。这是我实施的一部分[email protected]("/api/report/list") Observable<Bills> listBill(@Query("employee_id") String employeeID); 而条例草案类是-public static class…
改造正在返回一个空的响应主体 – java
我正在尝试使用Retrofit和Gson解析一些JSON。但是,我得到的响应机构是空的。当我尝试从对象中打印信息时,出现NullPointerException。我确保URL正确,并且我也确保POJO也正确。我正在使用jsonschema2pojo来帮助创建POJO类。这是我要解析的JSON{ "?xml": { "@versi…
每个文件合并后添加换行 – python
我有很多类似以下内容的JSON文件:例如。1.json{"name": "one", "description": "testDescription…", "comment": ""} test.json{"name"…
Json到php,json_decode返回NULL – php
我正在用PHP进行JSON解析器的一些API,用于存储有关遗产的信息。我在解析时遇到问题,因为它返回的是NULL值而不是数组或对象。简单的JSON代码可以很好地解析,但是可以这样:{"success":true,"totalCount":1,"data":[{"id":99694…
Sublime Text 3 Linter问题 – javascript
上周,我发现了这个很棒的文本编辑器“ Sublime Text 3”,我喜欢这些插件。除了SublimeLinter插件和为其添加语言特定棉絮的插件,其他所有东西都可以正常工作。我在与PHP和JavaScript配合使用时遇到问题:PHP确实可以工作,但是我不知道如何使JavaScript正常工作。对于php,我所做的是转到Pref> pac set&…
部分转自互联网,侵权删除联系
最新评论