|
I had been working on a program for quite some time. For some reason, though the code was running, the design mode got screwed up. There are several errors.
1. One of my custom controls no longer seems to have design mode available at all. It now just looks like C# code and not a custom control and when I double-click on it in the solution explorer no design mode comes up.
2. Another user control (that makes use of the previous control mentioned) cannot be changed on the main form at all. When I try to edit or even delete it I get this error:
"An error occurred while processing this command: Type 'Spring_2018_New_List_View_Macro_Box_Tester.lineItemData' in Assembly 'Spring 2018 New List View Macro Box Tester, Version 1.0.0.0, Culture = neutral, PublicKeyToken=Null' is not marked as serializable."
And under output I get "The program '[16676] Spring 2018 New List View Macro Box Tester.exe: Program Trace' has exited with code 0 (0x0).
The program '[16676] Spring 2018 New List View Macro Box Tester.exe' has exited with code 0 (0x0).
Thanks,
FC
|
|
|
|
|
The "project properties" of a file can get fouled; causing the "Designer" to have issues.
Sometimes you can just "add" the "item" back as an existing item.
Sometimes you have to create a "new" control and paste your existing code back in.
I've had 3rd party projects that refused to honor my "text formatting rules" until I "rebuilt" some files.
A project file "fix" may help; but can also make the entire project (file) unusable if done wrong.
"(I) am amazed to see myself here rather than there ... now rather than then".
― Blaise Pascal
|
|
|
|
|
I need help creating a class file that randomly generates a number of 10 characters, 0-9, A-Z. By generating a PIN it will create an authorization workflow to allow the user to authenticate the app. This number will be directed to a config file instead of a URL. The user goes thru a auth process and instead of calling back a URL there will be a page to randonly generate a pin. The randomly generated PIN will be stored in a database table.
For the database columns would get set properties be the best approach for each column in that table? Would this be the best approach for REST API? I am not very familiar with API's. Something like this
public class AuthorizationPIN
{
public int Id { get; set; }
public string AccessCode { get; set; }
public string PIN { get; set; }
}
|
|
|
|
|
You show one small component (of a larger process) and ask for "opinions".
At this point, it is neither right nor wrong.
"(I) am amazed to see myself here rather than there ... now rather than then".
― Blaise Pascal
|
|
|
|
|
Another smarmy smartass. Wow you are you f***ing dumb. I don't have any other code besides what I posted. I don't know where to begin with code to generate a PIN number that's why I asked!
F*** off a**hole seriously. I don't want to hear it from the moderators. There is no excuse for responding to me the way this guy responded to me. None!
|
|
|
|
|
|
And with a response like that you are hoping for support from a bunch of volunteers. If you don't like the response he gives you then ignore him as you will probably be ignored in the future.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Hello,
I have a probleme with the animation of my caracter. The animation run when my caracter stay put. I use Unity3D
<br />
using System.Collections;<br />
using System.Collections.Generic;<br />
using UnityEngine;<br />
<br />
public class PlayerMove : MonoBehaviour {<br />
<br />
private Animator anim;<br />
private CharacterController charController;<br />
private CollisionFlags collisionFlags = CollisionFlags.None;<br />
<br />
private float moveSpeed = 5f;<br />
private bool canMove;<br />
private bool finished_Movement = true;<br />
<br />
private Vector3 target_Pos = Vector3.zero;<br />
private Vector3 player_Move = Vector3.zero;<br />
<br />
private float player_ToPointDistance;<br />
<br />
private float gravity = 9.8f;<br />
private float height;<br />
<br />
void Awake () {<br />
anim = GetComponent<Animator> ();<br />
charController = GetComponent<CharacterController> ();<br />
}<br />
<br />
void Update () {<br />
MoveThePlayer ();<br />
charController.Move (player_Move);<br />
<br />
}<br />
<br />
void MoveThePlayer() {<br />
if (Input.GetMouseButtonDown (0)) {<br />
Ray ray = Camera.main.ScreenPointToRay (Input.mousePosition);<br />
RaycastHit hit;<br />
<br />
if (Physics.Raycast (ray, out hit)) {<br />
if(hit.collider is TerrainCollider) {<br />
<br />
player_ToPointDistance = Vector3.Distance (transform.position, hit.point);<br />
<br />
if (player_ToPointDistance >= 1.0f) {<br />
canMove = true;<br />
target_Pos = hit.point;<br />
}<br />
}<br />
<br />
}<br />
<br />
<br />
<br />
}<br />
<br />
if (canMove ) {<br />
anim.SetFloat ("Walk", 1.0f);<br />
<br />
Vector3 target_Temp = new Vector3 (target_Pos.x, transform.position.y, target_Pos.z);<br />
<br />
transform.rotation = Quaternion.Slerp (transform.rotation,<br />
Quaternion.LookRotation (target_Temp - transform.position),<br />
15.0f * Time.deltaTime);<br />
<br />
player_Move = transform.forward * moveSpeed * Time.deltaTime;<br />
<br />
if(Vector3.Distance (transform.position, target_Pos) <= 0.5f) {<br />
canMove = false;<br />
}<br />
<br />
} else {<br />
player_Move.Set (0f, 0f, 0f);<br />
anim.SetFloat ("walk", 0f);<br />
}<br />
<br />
}<br />
<br />
}<br />
<br />
If someone can help me I would be grateful
|
|
|
|
|
Too many "if's".
Just "move" in the Update to test that you can actually "move"; then add the "if's".
"(I) am amazed to see myself here rather than there ... now rather than then".
― Blaise Pascal
|
|
|
|
|
hello
i want to edit a file by c# string by this code
string text = File.ReadAllText(@"c:\a.txt", Encoding.UTF8);
string text1 = text.Replace("xx", XX");
File.WriteAllText(@"d:\a.txt", text1);
i want to search in string and when find example replace exam\ple and 4 word after exam\ple with exam\plexxxx
problem is i dont know what is the 4 word and i want replace.
i want any like * in windows seach.
in windows search * can support all character.
|
|
|
|
|
There is no wildcard support in the Replace method. You're going to have to write your own code to do search and replace with support for wildcards.
|
|
|
|
|
Sounds to me like a case for Regular expressions[^] Google will have lots of help.
Software rusts. Simon Stephenson, ca 1994. So does this signature. me, 2012
|
|
|
|
|
Get the ".IndexOf" your "keyword".
Then "string.Split" the rest into tokens / words; delimited by space, coma, etc.
The first 4 tokens are your "any character words".
Replace that part of the string between the "keyword" and the last word.
"(I) am amazed to see myself here rather than there ... now rather than then".
― Blaise Pascal
|
|
|
|
|
Looks like homework to me. And I suspect (and hope) the teacher has been teaching you something and that something is how you are supposed to be doing this.
|
|
|
|
|
i want to to write a program to correct program by edit one of bad file
|
|
|
|
|
That's different: in that case you definitely need a different approach. Reading and treating an executable file as text will corrupt the file; what you end up with is not going to be a valid executable, because the "translation" from the on-disk binary to text loses information, and the when you write it that cannot be recovered.
You would need to read the file as binary, handle it as binary, and write it back as binary as well.
But you also don't want to use the root folder of any drive: the access is restricted and likely to become more restricted in future.
Why do you think a program has a "bad file" that a simple text replace will fix?
Sent from my Amstrad PC 1640
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
my file is text file and not executable
this text file edit by program every run it but i want change one number after "id-number="
i dont know id-number in file but i want to change by my id number.
|
|
|
|
|
If you don't know the number you are replacing, then you need to look closely at the file, and check that the sequence "id-number=" only appears where you want to change it - that looks like a XML or config file and it's not guaranteed to have just a single occurrence.
But changing that is a text file is trivial: a basic regex will do it:
public static Regex regex = new Regex(
"(?<=id-number=)\\d+",
RegexOptions.IgnoreCase
| RegexOptions.CultureInvariant
| RegexOptions.IgnorePatternWhitespace
| RegexOptions.Compiled
);
public static string regexReplace = "98765";
...
string result = regex.Replace(InputText,regexReplace);
Sent from my Amstrad PC 1640
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
i do it by replace method but i have a problem
look to this please
i have : id number="5421" note:5421 is different by any run program
and i want to replace by : id number="2223"
i can replace "idnumber=" by "idnumber="2223"" but 3 number of old idnumber add to my file and my file corrupt.
this file is xml and i comment it this number but program detect Extra numbers and not run.
i want a command to can select by this method
string text1 = text.Replace("hostport=\"****\"", "hostport=\"2262\"");
and * mean is all character support.
thank you for replay
|
|
|
|
|
You can't use String.Replace - it doesn't support wildcards at all, that's why Regular Expressions exist. Look at what I gave you and get a copy of Expresso[^] - it's free, and it examines and generates Regular expressions.
Sent from my Amstrad PC 1640
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
thank you
regex support and my problem solved
|
|
|
|
|
You're welcome!
Sent from my Amstrad PC 1640
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Hi, i have MVC website application that is working slow from the client side, when opening a page ii takes 5-10 seconds.
when i using the website on the server its working fast.
the server is working fine, there are no cpu or memory problems.
we are using local network that is working fine with other systems.
what can cause this problem? are there any network configuration that i can add to the web.config that can helps?
|
|
|
|
|
Sou you have a local network with a server and some clients and on one client the loading is slow while it is OK with the others?
Then it is a problem of that specific client.
It may be hardware related (switch, cables, network card) which should be indicated by other network operations being slow too.
The system may be also badly configured (e.g. by prioritising specific protocols).
Finally, it can be sourced by other tasks performing huge network transfers. Then the problem should be gone once these tasks are done.
In any case it is not related to C#. We can also provide no further help because we have no access to your systems. If you have a network administrator at your side, ask him for help.
|
|
|
|
|
Gurus,
I have a c# windows form application. There is a PictureBox within a Panel. An image is loaded in the PictureBox. I want the image to be zoomed the area user selects. The user will select by dragging using the left mouse button. What i did is on the mouse down event, i saved the x/y in a variable and in mouse move event i am drawing the rectangle plus i am recording the x/y of the current position in another variable. And in mouse up event, i create a rectangle of the size of the selection made. And i create a bitmap using the rectangle's width and height. Then I created a graphics object using the created bitmap. Then i use the DrawImage function to draw the image to the bitmap created and assigned to the PictureBox. But it always takes the x/y coordinates from 0,0.
Please help
Vinu
|
|
|
|